PyTorch equivalent of np.broadcast()?

Is there a PyTorch equivalent to np.broadcast(*tensors) to compute the total size of a group of tensors as if they were to be added together?

there isn’t a pytorch function that does this yet.

@apaszke Recommended torch._C._infer_size(t1.size(), t2.size()) for this purpose.

Note that it’s fine for controlled usage in the core, and not meant to be a general solution, as we might change it any time. I recommended this in the context of torch.distributions.