Exemple #1
0
 def test(self):
   for multiple in [2, tf.constant(2)]:
     tile_lt = ops.tile(self.original_lt, {'z': multiple})
     golden_op = tf.tile(self.original_lt.tensor, [1, 1, multiple, 1])
     golden_axes = ['z' if axis.name == 'z' else axis
                    for axis in self.original_lt.axes.values()]
     golden_lt = core.LabeledTensor(golden_op, golden_axes)
     self.assertLabeledTensorsEqual(tile_lt, golden_lt)
Exemple #2
0
 def test_invalid_input(self):
     with self.assertRaisesRegexp(ValueError,
                                  'are not contained in the set'):
         ops.tile(self.original_lt, {'foo': 5})
     with self.assertRaisesRegexp(ValueError, 'axes with tick labels'):
         ops.tile(self.original_lt, {'x': 5})
Exemple #3
0
 def test_name(self):
     tile_lt = ops.tile(self.original_lt, {'z': 2})
     self.assertIn('lt_tile', tile_lt.name)
Exemple #4
0
 def test_invalid_input(self):
   with self.assertRaisesRegexp(ValueError, 'are not contained in the set'):
     ops.tile(self.original_lt, {'foo': 5})
   with self.assertRaisesRegexp(ValueError, 'axes with tick labels'):
     ops.tile(self.original_lt, {'x': 5})
Exemple #5
0
 def test_name(self):
   tile_lt = ops.tile(self.original_lt, {'z': 2})
   self.assertIn('lt_tile', tile_lt.name)