Hi,

I have a basic question from chapter 4, calculating the tensor mean along dimension 0.

The code from the notebook is:

mean3 = stacked_threes.mean(0)

show_image(mean3)

Playing around with the code I changed it to:

min3 = stacked_threes.min(0)

show_image(min3)

However this results in an error:

ValueError: only one element tensors can be converted to Python scalars

Why is this??

The difference seams to be the object types returned from mean() and min(). They are <class ‘torch.Tensor’> and <class ‘torch.return_types.min’>. But why is this?

I was expecting it to take the min along dimension 0 of the stacked tensor of 3s.

thanks

Norbert