def placeholder(shape=None, ndim=None, dtype=None, sparse=False, name=None):
 if (dtype is None):
  dtype = floatx()
 if (not shape):
  if ndim:
   shape = tuple([None for _ in range(ndim)])
 if sparse:
  x = tf.sparse_placeholder(dtype, name=name)
  x._dims = len(shape)
 else:
  x = tf.placeholder(dtype, shape=shape, name=name)
 x._keras_shape = shape
 x._uses_learning_phase = False
 return x

def placeholder ( shape = None , ndim = None , dtype = None , sparse = False , name = None ) : if ( dtype is None ) : dtype = floatx ( ) if ( not shape ) : if ndim : shape = tuple ( [ None for _ in range ( ndim ) ] ) if sparse : x = tf . sparse_placeholder ( dtype , name = name ) x . _dims = len ( shape ) else : x = tf . placeholder ( dtype , shape = shape , name = name ) x . _keras_shape = shape x . _uses_learning_phase = False return x
instantiates a placeholder tensor and returns it .