Understanding the Role of resize_out Function in PyTorch Operations

I have a question regarding the usage of the resize_out function in PyTorch operations. Specifically, when I specify an out tensor for an operation like torch.max(x, out=y), it seems that the resize_out function is called during the execution of the max operation to check the device and dtype of the output tensor (y). However, in the case of operations like torch.mul(x, 3, out=y), it appears that the resize_out function is not invoked.

I would like to understand under what circumstances the resize_out function is called and when it is not. Are there specific criteria or conditions that determine whether an operation will utilize resize_out to check the device and dtype of the specified output tensor?