torch.Tensor.sum_to_size¶ Tensor.sum_to_size(*size) → Tensor¶ 將 this 張量求和到指定尺寸 size。 size 必須可廣播到 this 張量尺寸。 引數 size (int...) – 一個整數序列,定義輸出張量的形狀。