用户可以通过torch框架生成Tensor数据作为输入数据/标杆数据,然后调用tensor_xxx接口导入,output数据落盘文件名为{name}_output.bin便于区分input数据。
import torch import ascendebug # 生成输入/标杆数据 x = torch.rand(size=(1, 16384), dtype=torch.float16) y = torch.rand(size=(1, 16384), dtype=torch.float16) z = x + y # 配置输入数据 debug_op = ascendebug.create_debug_op('add_custom').tensor_input('x', x) .tensor_input('y', y).tensor_output('z', z)
import torch import ascendebug # 生成输入/标杆数据 x = torch.rand(size=(1, 16384), dtype=torch.float16) y = torch.rand(size=(1, 16384), dtype=torch.float16) z = x + y # 配置输入数据 debug_op = ascendebug.create_debug_op('add_custom').tensor_input('x', x) .tensor_input('y', y).tensor_output('x', z)