def test_invalid_input(self): with self.assertRaises(ValueError): ops.concat([], 'channel') with self.assertRaises(ValueError): ops.concat([self.red_lt, self.red_lt], 'channel') with self.assertRaises(ValueError): ops.concat([self.red_lt, self.red_lt], 'foo')
def test_transposed(self): green_transposed = core.transpose(self.green_lt, ['probs', 'channel', 'z', 'x']) with self.assertRaises(ValueError): ops.concat([self.red_lt, green_transposed], 'channel')
def test(self): concat_lt = ops.concat([self.red_lt, self.green_lt], 'channel') golden_lt = ops.select(self.original_lt, {'channel': ['red', 'green']}) self.assertLabeledTensorsEqual(concat_lt, golden_lt)
def test_name(self): concat_lt = ops.concat([self.red_lt, self.blue_lt], 'channel') self.assertIn('lt_concat', concat_lt.name)