# Example 2 a ip_tensor=torch.randn(2,1,3,1) print(ip_tensor) print(f"Input Tensor shape:{ip_tensor.shape}\n") op_tensor=torch.squeeze(ip_tensor,dim=0) print(op_tensor) print(f"Output Tensor shape:{op_tensor.shape}\n") # Output tensor([[[[ 0.4133], [-0.6541], [-0.5506]]], [[[-1.1734], [-0.3823], [-0.8710]]]]) Input Tensor shape:torch.Size([2, 1, 3, 1]) tensor([[[[ 0.4133], [-0.6541], [-0.5506]]], [[[-1.1734], [-0.3823], [-0.8710]]]]) Output Tensor shape:torch.Size([2, 1, 3, 1])