mtzig commited on
Commit
9f4650b
1 Parent(s): 9b45d91

try diff format

Browse files
Files changed (1) hide show
  1. cross_entropy_loss.py +2 -2
cross_entropy_loss.py CHANGED
@@ -63,8 +63,8 @@ class cross_entropy_loss(evaluate.Metric):
63
  def _compute(self, prediction_scores, references):
64
  """Returns the scores"""
65
 
66
- loss = F.cross_entropy(input=torch.from_numpy(prediction_scores),
67
- target=torch.from_numpy(references),
68
  ignore_index=-100).item()
69
  return {
70
  "cross_entropy_loss": loss
 
63
  def _compute(self, prediction_scores, references):
64
  """Returns the scores"""
65
 
66
+ loss = F.cross_entropy(input=torch.tensor(prediction_scores),
67
+ target=torch.tensor(references),
68
  ignore_index=-100).item()
69
  return {
70
  "cross_entropy_loss": loss