torch_npu.npu_alloc_float_status(self) -> Tensor
为溢出检测模式申请tensor作为入参。
self (Tensor) - 任何张量。
1 2 3 4 5 6 7 | >>> input = torch.randn([1,2,3]).npu() >>> output = torch_npu.npu_alloc_float_status(input) >>> input tensor([[[ 2.2324, 0.2478, -0.1056], [ 1.1273, -0.2573, 1.0558]]], device='npu:0') >>> output tensor([0., 0., 0., 0., 0., 0., 0., 0.], device='npu:0') |