dataflow.get_running_device_id

Applicability

Product

Supported

Atlas A3 training product/Atlas A3 inference product

Atlas A2 training product/Atlas A2 inference product

Atlas 200I/500 A2 inference product

x

Atlas inference product

x

Atlas training product

x

Function Description

Obtains the ID of the device where the current UDF runs during execution. This information is sourced from the logic_device_list configuration in the data_flow_deploy_info.json file.

Prototype

1
get_running_device_id()

Parameters

None

Returns

ID of the device where the current UDF runs. The data type is int.

Examples

1
2
3
4
5
6
import dataflow as df

@df.pyflow
def func():
    print('running device_id = ', df.get_running_device_id())
    return a + b

Constraints

This API must be used with the pyflow decorator.