Efficiency of torch.cat

How efficient is torch.cat? I am assuming that it reallocates everything that is passed as an argument. Is that true ?

1 Like

yes, it pre-allocates the full tensor and then copy into it each element.

1 Like