文档
注册

beta)torch_npu.npu_format_cast_

接口原型

torch_npu.npu_format_cast_(self, src) -> Tensor

功能描述

原地修改self张量格式,与src格式保持一致。

参数说明

  • self (Tensor) - 输入张量。
  • src (Tensor,int) - 目标格式。

调用示例

>>> x = torch.rand(2, 3, 4, 5).npu()
>>> torch_npu.get_npu_format(x)
0
>>> torch_npu.get_npu_format(x.npu_format_cast_(29))
29
搜索结果
找到“0”个结果

当前产品无相关内容

未找到相关内容,请尝试其他搜索词