Example #1
0
 def test_loss_with_packed_sequence(self):
     actual = pt.softmax_cross_entropy(self.packed_logits,
                                       self.packet_targets).numpy()
     np.testing.assert_allclose(actual, self.reference_loss, rtol=1e-4)
Example #2
0
 def test_loss_when_padded_correctly(self):
     actual = pt.softmax_cross_entropy(self.logits, self.targets).numpy()
     np.testing.assert_allclose(actual, self.reference_loss, rtol=1e-4)