torch.Tensor.sum_to_size Tensor.sum_to_size(*size) → Tensor 将 this 张量累加到 size。同时,size 必须可以广播到 this 张量的大小。 参数 size (int...) – 一个由定义输出张量形状的整数组成的序列。