def int_shape(x):
 if hasattr(x, '_keras_shape'):
  return x._keras_shape
 else:
  raise Exception('Not a Keras tensor:', x)

def int_shape ( x ) : if hasattr ( x , '_keras_shape' ) : return x . _keras_shape else : raise Exception ( 'Not a Keras tensor:' , x )
returns the shape of a keras tensor or a keras variable as a tuple of integers or none entries .