torch.Tensor.sum_to_size¶ Tensor.sum_to_size(*size) → Tensor¶ 将 this 张量求和到指定尺寸 size。 size 必须可广播到 this 张量尺寸。 参数 size (int...) – 一个整数序列,定义输出张量的形状。