torch_npu.npu_format_cast(self, acl_format) -> Tensor
修改NPU张量的格式。
1 2 3 4 5 6
>>> x = torch.rand(2, 3, 4, 5).npu() >>> torch_npu.get_npu_format(x) 0 >>> x1 = torch_npu.npu_format_cast(x, 2) >>> torch_npu.get_npu_format(x1) 2