albanD:

This is only true for an output with a single element!


Thanks for the help. Just one more thing. It seems that by the code you posted, passing in torch.ones(...) will not have a material affect on the final outcome, right? seems like that conflicts with the comment about a single element, but I am not sure