3)# 对输入张量进行2倍大小重复returnoutputclassCustomRepeatInterleave(Function):@staticmethoddefforward(ctx,input):# 前向传播output=input.repeat(2,3)# 计算梯度# ...returnoutput# 使用自定义的repeat_interleave函数x=torch.tensor([1,2,3])y=CustomRepeatInterleave.apply(x...
@jerrylsu 如果需要梯度回传的话确实不能转成numpy,可以按照上述issue中的建议来处理 Duplicate of #33210 pytorch repeat_interleave算子 # pytorch a = torch.tensor([[1, 2, 3], [4, 5, 6]]) print(a.shape) print(a) > torch.Size([2, 3]) > tensor([[1, 2, 3], [4, 5, 6]]) b...
Hi! We've received your issue and please be patient to get responded. We will arrange technician...
Hi! We've received your issue and please be patient to get responded. We will arrange technician...