(value, expected_shape, name='')
Throws a ValueError if value.shape != expected_shape.
    Args:
        value: Matrix to shape check.
        expected_shape: A tuple or list of integers.
        name: An optional name to add to the exception message.
Throws a ValueError if value.shape != expected_shape.
    Args:
        value: Matrix to shape check.
        expected_shape: A tuple or list of integers.
        name: An optional name to add to the exception message.
Throws a ValueError if value . shape ! = expected_shape . Args : value : Matrix to shape check . expected_shape : A tuple or list of integers . name : An optional name to add to the exception message .
def check_shape(value, expected_shape, name=''):
    """
    Throws a ValueError if value.shape != expected_shape.
    Args:
        value: Matrix to shape check.
        expected_shape: A tuple or list of integers.
        name: An optional name to add to the exception message.
    """
    if value.shape != tuple(expected_shape):
        raise ValueError('Shape mismatch %s: Expected %s, got %s' %
                         (name, str(expected_shape), str(value.shape)))
def check_shape ( value , expected_shape , name = '' ) : if value . shape != tuple ( expected_shape ) : raise ValueError ( 'Shape mismatch %s: Expected %s, got %s' % ( name , str ( expected_shape ) , str ( value . shape ) ) )