torch.broadcast_shapes
- torch.broadcast_shapes(*shapes) → Size
Similar to
broadcast_tensors()but for shapes.This is equivalent to
but avoids the need to create intermediate tensors. This is useful for broadcasting tensors of common batch shape but different rightmost shape, e.g. to broadcast mean vectors with covariance matrices.