def get_dims(x):
 if (isinstance(x, float) or isinstance(x, int)):
  return []
 elif (isinstance(x, tf.Tensor) or isinstance(x, tf.Variable)):
  return x.get_shape().as_list()
 elif isinstance(x, np.ndarray):
  return list(x.shape)
 elif isinstance(x, RandomVariable):
  return x.get_batch_shape().as_list()
 else:
  raise NotImplementedError()

def get_dims ( x ) : if ( isinstance ( x , float ) or isinstance ( x , int ) ) : return [ ] elif ( isinstance ( x , tf . Tensor ) or isinstance ( x , tf . Variable ) ) : return x . get_shape ( ) . as_list ( ) elif isinstance ( x , np . ndarray ) : return list ( x . shape ) elif isinstance ( x , RandomVariable ) : return x . get_batch_shape ( ) . as_list ( ) else : raise NotImplementedError ( )
get values of each dimension .