parameters: (decoder)
docstring: Sanity check for CharDecoder.train_forward()
          basic shape check
docstring_summary: Sanity check for CharDecoder.train_forward()
          basic shape check
docstring_tokens: Sanity check for CharDecoder . train_forward () basic shape check
function: def question_2b_sanity_check(decoder):
      """ Sanity check for CharDecoder.train_forward()
          basic shape check
      """
      print ("-"*80)
      print("Running Sanity Check for Question 2b: CharDecoder.train_forward()")
      print ("-"*80)
      sequence_length = 4
      inpt = torch.zeros(sequence_length, BATCH_SIZE, dtype=torch.long)
      loss = decoder.train_forward(inpt)
      assert(list(loss.size()) == []), "Loss should be a scalar but its shape is: {}".format(list(loss.size()))
      print("Sanity Check Passed for Question 2b: CharDecoder.train_forward()!")
      print("-"*80)
function_tokens: def question_2b_sanity_check ( decoder ) : print ( "-" * 80 ) print ( "Running Sanity Check for Question 2b: CharDecoder.train_forward()" ) print ( "-" * 80 ) sequence_length = 4 inpt = torch . zeros ( sequence_length , BATCH_SIZE , dtype = torch . long ) loss = decoder . train_forward ( inpt ) assert ( list ( loss . size ( ) ) == [ ] ) , "Loss should be a scalar but its shape is: {}" . format ( list ( loss . size ( ) ) ) print ( "Sanity Check Passed for Question 2b: CharDecoder.train_forward()!" ) print ( "-" * 80 )