def get_incoming_shape(incoming):
 if isinstance(incoming, tf.Tensor):
  return incoming.get_shape().as_list()
 elif (type(incoming) in [np.array, list, tuple]):
  return np.shape(incoming)
 else:
  raise Exception('Invalid incoming layer.')

def get_incoming_shape ( incoming ) : if isinstance ( incoming , tf . Tensor ) : return incoming . get_shape ( ) . as_list ( ) elif ( type ( incoming ) in [ np . array , list , tuple ] ) : return np . shape ( incoming ) else : raise Exception ( 'Invalid incoming layer.' )
returns the incoming data shape .