Class Execute

Class Documentation

class Execute

Public Functions

explicit Execute(std::shared_ptr<TensorOperation> op, MapTargetDevice device_type = MapTargetDevice::kCpu, uint32_t device_id = 0)

Constructor.

Parameters
  • op[in] TensorOperation to be applied in Eager mode, it accepts operation in type of shared pointer.

  • device_type[in] Target device environment to perform operation, can be kCPU/kGPU/kAscend310 (default=kCPU).

  • device_id[in] Target device ID to perform operation, only valid when device_type=kAscend310 (default=0).

explicit Execute(std::shared_ptr<TensorTransform> op, MapTargetDevice device_type = MapTargetDevice::kCpu, uint32_t device_id = 0)

Constructor.

Parameters
  • op[in] TensorTransform to be applied in Eager mode, it accepts operation in type of shared pointer.

  • device_type[in] Target device environment to perform operation, can be kCPU/kGPU/kAscend310 (default=kCPU).

  • device_id[in] Target device ID to perform operation, only valid when device_type=kAscend310 (default=0).

explicit Execute(std::reference_wrapper<TensorTransform> op, MapTargetDevice device_type = MapTargetDevice::kCpu, uint32_t device_id = 0)

Constructor.

Parameters
  • op[in] TensorTransform to be applied in Eager mode, it accepts operation in type of reference.

  • device_type[in] Target device environment to perform operation, can be kCPU/kGPU/kAscend310 (default=kCPU).

  • device_id[in] Target device ID to perform operation, only valid when device_type=kAscend310 (default=0).

explicit Execute(TensorTransform *op, MapTargetDevice device_type = MapTargetDevice::kCpu, uint32_t device_id = 0)

Constructor.

Parameters
  • op[in] TensorTransform to be applied in Eager mode, it accepts operation in type of raw pointer.

  • device_type[in] Target device environment to perform operation, can be kCPU/kGPU/kAscend310 (default=kCPU).

  • device_id[in] Target device ID to perform operation, only valid when device_type=kAscend310 (default=0).

explicit Execute(std::vector<std::shared_ptr<TensorOperation>> ops, MapTargetDevice device_type = MapTargetDevice::kCpu, uint32_t device_id = 0)

Constructor.

Parameters
  • ops[in] A vector of TensorOperations to be applied in Eager mode, it accepts operation in type of shared pointer.

  • device_type[in] Target device environment to perform operation, can be kCPU/kGPU/kAscend310 (default=kCPU).

  • device_id[in] Target device ID to perform operation, only valid when device_type=kAscend310 (default=0).

explicit Execute(std::vector<std::shared_ptr<TensorTransform>> ops, MapTargetDevice device_type = MapTargetDevice::kCpu, uint32_t device_id = 0)

Constructor.

Parameters
  • ops[in] A vector of TensorTransforms to be applied in Eager mode, it accepts operation in type of shared pointer.

  • device_type[in] Target device environment to perform operation, can be kCPU/kGPU/kAscend310 (default=kCPU).

  • device_id[in] Target device ID to perform operation, only valid when device_type=kAscend310 (default=0).

explicit Execute(const std::vector<std::reference_wrapper<TensorTransform>> ops, MapTargetDevice device_type = MapTargetDevice::kCpu, uint32_t device_id = 0)

Constructor.

Parameters
  • ops[in] A vector of TensorTransforms to be applied in Eager mode, it accepts operation in type of raw pointer.

  • device_type[in] Target device environment to perform operation, can be kCPU/kGPU/kAscend310 (default=kCPU).

  • device_id[in] Target device ID to perform operation, only valid when device_type=kAscend310 (default=0).

explicit Execute(const std::vector<TensorTransform*> &ops, MapTargetDevice device_type = MapTargetDevice::kCpu, uint32_t device_id = 0)

Constructor.

Parameters
  • ops[in] A vector of TensorTransforms to be applied in Eager mode, it accepts operation in type of raw pointer.

  • device_type[in] Target device environment to perform operation, can be kCPU/kGPU/kAscend310 (default=kCPU).

  • device_id[in] Target device ID to perform operation, only valid when device_type=kAscend310 (default=0).

~Execute()

Destructor.

Status operator()(const mindspore::MSTensor &input, mindspore::MSTensor *output)

Callable function to execute the TensorTransform in eager mode.

Parameters
  • input[in] Tensor to be transformed.

  • output[out] Transformed tensor.

Returns

Status error code, returns OK if no error encountered.

Status operator()(const std::vector<mindspore::MSTensor> &input_tensor_list, std::vector<mindspore::MSTensor> *out)

Callable function to execute the TensorTransform in eager mode.

Parameters
  • input_tensor_list[in] List of Tensor to be transformed.

  • out[out] Result tensor after transform.

Returns

Status error code, returns OK if no error encountered.

Status DeviceMemoryRelease()

The function to release device memory on Ascend310.

std::string AippCfgGenerator()

The function to generate AIPP configuration.