Exemplo n.º 1
0
 def test_invalid_input(self):
     with self.assertRaises(ValueError):
         ops.squeeze(self.original_lt, ['channel'])
     with self.assertRaises(ValueError):
         ops.squeeze(self.squeezable_lt, ['foo'])
Exemplo n.º 2
0
 def test_none(self):
     none_lt = ops.squeeze(self.squeezable_lt, None)
     axes_lt = ops.squeeze(self.squeezable_lt, ['channel', 'probs'])
     self.assertLabeledTensorsEqual(none_lt, axes_lt)
Exemplo n.º 3
0
 def test(self):
     squeeze_lt = ops.squeeze(self.squeezable_lt, ['probs'])
     golden_lt = core.slice_function(self.squeezable_lt, {'probs': 0})
     self.assertLabeledTensorsEqual(squeeze_lt, golden_lt)
Exemplo n.º 4
0
 def test_name(self):
     squeeze_lt = ops.squeeze(self.squeezable_lt)
     self.assertIn('lt_squeeze', squeeze_lt.name)
Exemplo n.º 5
0
 def test_invalid_input(self):
   with self.assertRaises(ValueError):
     ops.squeeze(self.original_lt, ['channel'])
   with self.assertRaises(ValueError):
     ops.squeeze(self.squeezable_lt, ['foo'])
Exemplo n.º 6
0
 def test(self):
   squeeze_lt = ops.squeeze(self.squeezable_lt, ['probs'])
   golden_lt = core.slice_function(self.squeezable_lt, {'probs': 0})
   self.assertLabeledTensorsEqual(squeeze_lt, golden_lt)
Exemplo n.º 7
0
 def test_none(self):
   none_lt = ops.squeeze(self.squeezable_lt, None)
   axes_lt = ops.squeeze(self.squeezable_lt, ['channel', 'probs'])
   self.assertLabeledTensorsEqual(none_lt, axes_lt)
Exemplo n.º 8
0
 def test_name(self):
   squeeze_lt = ops.squeeze(self.squeezable_lt)
   self.assertIn('lt_squeeze', squeeze_lt.name)