def test_x_has_non_empty_batch_shape(self): with self.test_session(): x = self._rng.rand(2, 3, 4, 5) num_event_dims = 2 batch_shape = operator_pd.extract_batch_shape(x, num_event_dims) self.assertAllEqual([2, 3], batch_shape.eval())
def test_x_has_empty_batch_shape(self): with self.test_session(): x = self._rng.rand(2, 3) num_event_dims = 2 batch_shape = operator_pd.extract_batch_shape(x, num_event_dims) self.assertAllEqual([], batch_shape.eval())
def testXHasNonEmptyBatchShape(self): with self.test_session(): x = self._rng.rand(2, 3, 4, 5) num_event_dims = 2 batch_shape = operator_pd.extract_batch_shape(x, num_event_dims) self.assertAllEqual([2, 3], batch_shape.eval())
def testXHasEmptyBatchShape(self): with self.test_session(): x = self._rng.rand(2, 3) num_event_dims = 2 batch_shape = operator_pd.extract_batch_shape(x, num_event_dims) self.assertAllEqual([], batch_shape.eval())