Ejemplo n.º 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)
Ejemplo n.º 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})
Ejemplo n.º 3
0
 def test_name(self):
     tile_lt = ops.tile(self.original_lt, {'z': 2})
     self.assertIn('lt_tile', tile_lt.name)
Ejemplo n.º 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})
Ejemplo n.º 5
0
 def test_name(self):
   tile_lt = ops.tile(self.original_lt, {'z': 2})
   self.assertIn('lt_tile', tile_lt.name)