torch.Tensor.expand_as¶ Tensor.expand_as(other) → Tensor¶ 将此张量扩展到与 other 相同的尺寸。 self.expand_as(other) 等同于 self.expand(other.size()) 。 请参阅 expand() 获取更多关于 expand 的信息。 参数: 其他( torch.Tensor )- 结果张量的大小与 other 相同。