def test_validating_dataset_input_tensors_with_shape_mismatch(self):
    with self.cached_session():
        strategy = mirrored_strategy.MirroredStrategy(['/device:GPU:0', '/device:CPU:0'])
        a = constant_op.constant([1, 2], shape=(1, 2))
        b = constant_op.constant([[1, 2], [1, 2]], shape=(2, 2))
        x = values.DistributedValues({'/device:CPU:0': a, '/device:GPU:0': b})
        y = values.DistributedValues({'/device:CPU:0': a, '/device:GPU:0': a})
        with strategy.scope():
            with self.assertRaisesRegexp(ValueError, 'Input tensor shapes do not match for distributed tensor inputs DistributedValues:.+'):
                distributed_training_utils.validate_distributed_dataset_inputs(strategy, x, y)
def test_validating_dataset_input_tensors_with_shape_mismatch(self):
    with self.cached_session():
        strategy = mirrored_strategy.MirroredStrategy(['/device:GPU:0', '/device:CPU:0'])
        a = constant_op.constant([1, 2], shape=(1, 2))
        b = constant_op.constant([[1, 2], [1, 2]], shape=(2, 2))
        x = values.DistributedValues({'/device:CPU:0': a, '/device:GPU:0': b})
        y = values.DistributedValues({'/device:CPU:0': a, '/device:GPU:0': a})
        with strategy.scope():
            with self.assertRaisesRegexp(ValueError, 'Input tensor shapes do not match for distributed tensor inputs DistributedValues:.+'):
                distributed_training_utils.validate_distributed_dataset_inputs(strategy, x, y)