assert numpy.equal(expected_loss.data.numpy(), actual_loss.data.numpy())
def test_decode_runs_correctly(self):
training_arrays = arrays_to_variables(self.dataset.as_array_dict())
output_dict = self.model.forward(**training_arrays)
decode_output_dict = self.model.decode(output_dict)
// ``decode`` should have added a ``predicted_tokens`` field to ``output_dict``. Checking if it"s there.
assert "predicted_tokens" in decode_output_dict
After Change
assert numpy.equal(expected_loss.data.numpy(), actual_loss.data.numpy())
def test_decode_runs_correctly(self):
training_tensors = self.dataset.as_tensor_dict()
output_dict = self.model.forward(**training_tensors)
decode_output_dict = self.model.decode(output_dict)
// ``decode`` should have added a ``predicted_tokens`` field to ``output_dict``. Checking if it"s there.
assert "predicted_tokens" in decode_output_dict