1 报错描述
1.1 系统环境
Hardware Environment(Ascend/GPU/CPU): CPU Software Environment: -- MindSpore version (source or binary): 1.8.0 -- Python version (e.g., Python 3.7.5): 3.7.6 -- OS platform and distribution (e.g., Linux Ubuntu 16.04): Ubuntu 4.15.0-74-generic -- GCC/Compiler version (if compiled from source):
1.2 基本信息
1.2.1 脚本
训练脚本是通过构建TopK单算子网络计算Tensor最后一维的前k个最大值。脚本如下:
01 class Net(nn.Cell):
02 def __init__(self):
03 super(Net, self).__init__()
04 self.topk = ops.TopK(sorted=False)
05
06 def construct(self, x, k):
07 output = self.topk(x, k)
08 return output
09
10 net = Net()
11 x = Tensor(([[5, 2, 3, 3, 5], [5, 2, 9, 3, 5]]), mindspore.double)
12 k = 5
13 values, indices = net(x, k)
14 print(values, indices)
复制
1.2.2 报错
这里报错信息如下: