# Example 2 b 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=1) print(op_tensor) print(f"Output Tensor shape:{op_tensor.shape}\n") # Output tensor([[[[-1.7004], [-0.1863], [ 1.1550]]], [[[-1.1890], [-0.4821], [-0.3731]]]]) Input Tensor shape:torch.Size([2, 1, 3, 1]) tensor([[[-1.7004], [-0.1863], [ 1.1550]], [[-1.1890], [-0.4821], [-0.3731]]]) Output Tensor shape:torch.Size([2, 3, 1])