Esempio n. 1
0
    def test(self):
        unpack_lt = ops.unpack(self.original_lt)[0]
        golden_lt = core.LabeledTensor(
            array_ops.unstack(self.original_lt.tensor)[0],
            [self.a1, self.a2, self.a3])

        self.assertLabeledTensorsEqual(unpack_lt, golden_lt)
Esempio n. 2
0
    def test_axis(self):
        unpack_lt = ops.unpack(self.original_lt, axis_name='z')[0]
        golden_lt = core.LabeledTensor(
            array_ops.unstack(self.original_lt.tensor, axis=2)[0],
            [self.a0, self.a1, self.a3])

        self.assertLabeledTensorsEqual(unpack_lt, golden_lt)
Esempio n. 3
0
  def test_axis(self):
    unpack_lt = ops.unpack(self.original_lt, axis_name='z')[0]
    golden_lt = core.LabeledTensor(
        array_ops.unstack(
            self.original_lt.tensor, axis=2)[0], [self.a0, self.a1, self.a3])

    self.assertLabeledTensorsEqual(unpack_lt, golden_lt)
Esempio n. 4
0
  def test(self):
    unpack_lt = ops.unpack(self.original_lt)[0]
    golden_lt = core.LabeledTensor(
        array_ops.unstack(self.original_lt.tensor)[0],
        [self.a1, self.a2, self.a3])

    self.assertLabeledTensorsEqual(unpack_lt, golden_lt)
Esempio n. 5
0
 def test_invalid_input(self):
     with self.assertRaises(ValueError):
         ops.unpack(self.original_lt, axis_name='not_found')
Esempio n. 6
0
 def test_name(self):
     unpack_lts = ops.unpack(self.original_lt)
     for t in unpack_lts:
         self.assertIn('lt_unpack', t.name)
Esempio n. 7
0
 def test_invalid_input(self):
   with self.assertRaises(ValueError):
     ops.unpack(self.original_lt, axis_name='not_found')
Esempio n. 8
0
 def test_name(self):
   unpack_lts = ops.unpack(self.original_lt)
   for t in unpack_lts:
     self.assertIn('lt_unpack', t.name)