def interpret_in_shape(xshape):
 if isinstance(xshape, (int, np.integer)):
  return (xshape, 1)
 elif (len(xshape) == 2):
  return xshape
 else:
  return (np.prod(xshape), 1)

def interpret_in_shape ( xshape ) : if isinstance ( xshape , ( int , np . integer ) ) : return ( xshape , 1 ) elif ( len ( xshape ) == 2 ) : return xshape else : return ( np . prod ( xshape ) , 1 )
helper function to interpret the tensor layout of preceding layer for input to a recurrent layer .