You could visualize a single slice from the depth dimension e.g. using matplotlib and indexing:
c, h, w, d
x = torch.randn(c, h, w, d)
plt.imshow(x[0, :, :, 0])

or you could also use torchvision.utils.make_grid to create a single image with all slices:
from torchvision.utils import make_grid

# permute to treat depth as "batch dim"
x_grid = make_grid(x.permute(1, 0, 2, 3)) 
# permute to create channels-last array (for matplotlib)
x_grid = x_grid.permute(1, 2, 0).numpy()
plt.imshow(x_grid)

Also, have a look at @MONAI’s plot_2d_or_3d_image 39, which can apparently plot these 3D images as GIFs into TensorBoard.