Error in the code

I was trying the same code as given and running it on google colab. Its continuously showing error as 3 tensors sent and expected 1. How should I resolve the error?