---
title: 函数：set_ts_device
description: "| 产品 | 是否支持 |"
url: https://www.hiascend.com/document/detail/zh/canncommercial/latest/API/runtimeapi/aclpythondevg_01_0066.html
sourcePath: /source/zh/canncommercial/900/API/runtimeapi/aclpythondevg_01_0066.html
indexId: f387c20f261171e257f7f234a0f5b5bb6bc5530c14137e9e6480dd45164f158671
---
# 函数：set_ts_device

#### 产品支持情况

| 产品 | 是否支持 |
| --- | --- |
| Atlas 350 加速卡 | √ |
| Atlas A3 训练系列产品 / Atlas A3 推理系列产品 | √ |
| Atlas A2 训练系列产品 / Atlas A2 推理系列产品 | √ |
| Atlas 训练系列产品 | √ |
| Atlas 推理系列产品 | √ |
| Atlas 200I/500 A2 推理产品 | √ |


#### 功能说明

设置本次计算需要使用的Task Schedule。


#### 函数原型

- C函数原型
  1 aclError aclrtSetTsDevice(aclrtTsId tsId)

- python函数
  1 ret = acl.rt.set_ts_device(ts_id)


#### 参数说明

| 参数名 | 说明 |
| --- | --- |
| ts\_Id | int，指定本次计算需要使用的Task Schedule。如果昇腾AI软件栈中仅有AICORE Task Schedule，则设置该参数无效，默认使用AICORE Task Schedule。 0：ACL\_TS\_ID\_AICORE，使用AICORE Task Schedule。 1：ACL\_TS\_ID\_AIVECTOR，使用AIVECTOR Task Schedule。 2：ACL\_TS\_ID\_RESERVED。 |


#### 返回值说明

| 返回值 | 说明 |
| --- | --- |
| ret | int，错误码，返回0表示成功，返回其它值表示失败。 |
