tensor_input

函数功能

向DebugOp对象中增加Tensor类型的输入描述。

函数原型

def tensor_input(self, input_name: str, input_tensor: Any, options=None)

参数说明

参数名

输入/输出

说明

input_name

输入

字符串,输入描述的name。

input_tensor

输入

待添加的Tensor对象(由torch或者numpy生成)。

options

输入

其他可选参数配置,list格式,可选填"optional"、"ignore"。

  • 若options=["optional"],表示本输入是可选的。
  • 若options=["ignore"],表示本输入是可忽略的。

返回值

返回DebugOp类型的自身实例对象。

使用说明

import ascendebug
import numpy as np
x = np.random.uniform(1, 100, (16384)).astype(np.float16)
ascendebug.create_debug_op('OpCustom', 'VectorCore', '${chip_version}').tensor_input('x', x)