(array, constant=False)
return array
Convert a numpy array to ``theano.tensor.TensorType`` instance.
Convert a numpy array to ``theano.tensor.TensorType`` instance.
Convert a numpy array to theano . tensor . TensorType instance .
def to_theano(array, constant=False):
    """Convert a numpy array to ``theano.tensor.TensorType`` instance."""
    import theano

    if isinstance(array, np.ndarray):
        if constant:
            return theano.tensor.constant(array)

        return theano.tensor.TensorType(dtype=array.dtype, broadcastable=[False] * len(array.shape))()

    return array
def to_theano ( array , constant = False ) : import theano if isinstance ( array , np . ndarray ) : if constant : return theano . tensor . constant ( array ) return theano . tensor . TensorType ( dtype = array . dtype , broadcastable = [ False ] * len ( array . shape ) ) ( ) return array