C4w5: Triplet loss

Hello everyone,

Could you please help me identify what my be the problem with my code?
As a result, I’m getting the loss as a ‘tensor with the constant right value’ instead of the expected constant value as shown bellow. No error message is raised. I’ve tried to turn the tensor into a constant by evaluating it (like this: loss.eval() ), but ending up with an error.

Why do you believe that it’s a problem that your loss value ends up as a tensor? Is any error thrown because of that? Mine is also a tensor and it was accepted by the tests in the notebook and the grader.

Here’s another recent thread on the same topic.

1 Like

Hi Paul,

Thank you for replying. There is no error thrown because it was a tensor, I was just trying to compare the output (including the type and the shape) to the expected output of the test cell.
I also followed the link you shared and noticed that my concern was completely discussed there.

Thank you.