class_docstr: Symbolic `Type` representing a numpy.ndarray value.
  
  Initialize self.dtype and self.broadcastable.
  
  Parameters
  ----------
  dtype: str
      Corresponding to numpy dtype (e.g., 'int64')
      The value (ndarray) associated to a `Variable` of this `Type` will
      have this dtype.
  broadcastable: tuple, list, or array of boolean values
      This argument serves two purposes. First, the True elements of this
      list indicate the dimensions where the shape of an associated value
      must be 1. Secondly, the length of this list is the number of
      dimensions that an associated value must have. See
      doc:`broadcasting` for an explanation of how this list is used.
  name : str
      Optional name for this type.
class_docstr_tok: ["Symbolic","`","Type","`","representing","a","numpy.ndarray","value",".","Initialize","self.dtype","and","self.broadcastable",".","Parameters","--","--","--","--","--","dtype",":","str","Corresponding","to","numpy","dtype","(","e.g.",",","'int64","'",")","The","value","(","ndarray",")","associated","to","a","`","Variable","`","of","this","`","Type","`","will","have","this","dtype",".","broadcastable",":","tuple",",","list",",","or","array","of","boolean","values","This","argument","serves","two","purposes",".","First",",","the","True","elements","of","this","list","indicate","the","dimensions","where","the","shape","of","an","associated","value","must","be","1",".","Secondly",",","the","length","of","this","list","is","the","number","of","dimensions","that","an","associated","value","must","have",".","See","doc",":","`","broadcasting","`","for","an","explanation","of","how","this","list","is","used",".","name",":","str","Optional","name","for","this","type","."]
docstr: Convert `data` to something which can be associated to a
  `TensorVariable`.
  
  This function is not meant to be called in user code. It is for
  `Linker` instances to use when running a compiled graph.
docstr_tok: ["Convert","`","data","`","to","something","which","can","be","associated","to","a","`","TensorVariable","`",".","This","function","is","not","meant","to","be","called","in","user","code",".","It","is","for","`","Linker","`","instances","to","use","when","running","a","compiled","graph","."]
code: def filter(self, data, strict=False, allow_downcast=None):
      """
      Convert `data` to something which can be associated to a
      `TensorVariable`.
  
      This function is not meant to be called in user code. It is for
      `Linker` instances to use when running a compiled graph.
  
      """
      # Explicit error message when one accidentally uses a Variable as
      # input (typical mistake, especially with shared variables).
      if isinstance(data, Variable):
          raise TypeError(
              "Expected an array-like object, but found a Variable: "
              "maybe you are trying to call a function on a (possibly "
              "shared) variable instead of a numeric array?"
          )
  
      if (type(data) is np.ndarray) and (
          data.dtype == self.numpy_dtype
      ):
          if data.dtype.num != self.numpy_dtype.num:
              data = theano._asarray(data, dtype=self.dtype)
          # -- now fall through to ndim check
      elif (type(data) is np.memmap) and (
          data.dtype == self.numpy_dtype
      ):
          # numpy.memmap is a "safe" subclass of ndarray,
          # so we can use it wherever we expect a base ndarray.
          # however, casting it would defeat the purpose of not
          # loading the whole data into memory
          pass
      elif strict:
          # If any of the two conditions above was not met,
          # we raise a meaningful TypeError.
          if not (type(data) is np.ndarray):
              raise TypeError(
                  "%s expected a ndarray object." % self,
                  data,
                  type(data),
              )
          if data.dtype != self.numpy_dtype:
              raise TypeError(
                  (
                      "%s expected a ndarray object with "
                      "dtype = %s (got %s)."
                  )
                  % (self, self.numpy_dtype, data.dtype)
              )
          assert False, "This point should never be reached."
      else:
          if allow_downcast:
              # Convert to self.dtype, regardless of the type of data
              data = theano._asarray(data, dtype=self.dtype)
              # TODO: consider to pad shape with ones to make it consistent
              # with self.broadcastable... like vector->row type thing
          else:
              if isinstance(data, np.ndarray):
                  # Check if self.dtype can accurately represent data
                  # (do not try to convert the data)
                  up_dtype = scal.upcast(self.dtype, data.dtype)
                  if up_dtype == self.dtype:
                      # Bug in the following line when data is a
                      # scalar array, see
                      # http://projects.scipy.org/numpy/ticket/1611
                      # data = data.astype(self.dtype)
                      data = theano._asarray(data, dtype=self.dtype)
                  if up_dtype != self.dtype:
                      err_msg = (
                          "%s cannot store a value of dtype %s without "
                          "risking loss of precision. If you do not mind "
                          "this loss, you can: "
                          "1) explicitly cast your data to %s, or "
                          '2) set "allow_input_downcast=True" when calling '
                          '"function". Value: "%s"'
                          % (self, data.dtype, self.dtype, repr(data))
                      )
                      raise TypeError(err_msg)
              elif (
                  allow_downcast is None
                  and type(data) is float
                  and self.dtype == theano.config.floatX
              ):
                  # Special case where we allow downcasting of Python float
                  # literals to floatX, even when floatX=='float32'
                  data = theano._asarray(data, self.dtype)
              else:
                  # data has to be converted.
                  # Check that this conversion is lossless
                  converted_data = theano._asarray(data, self.dtype)
                  # We use the `values_eq` static function from TensorType
                  # to handle NaN values.
                  if TensorType.values_eq(
                      np.asarray(data),
                      converted_data,
                      force_same_dtype=False,
                  ):
                      data = converted_data
                  else:
                      # Do not print a too long description of data
                      # (ndarray truncates it, but it's not sure for data)
                      str_data = str(data)
                      if len(str_data) > 80:
                          str_data = str_data[:75] + "(...)"
  
                      err_msg = (
                          "%s cannot store accurately value %s, "
                          "it would be represented as %s. "
                          "If you do not mind this precision loss, you can: "
                          "1) explicitly convert your data to a numpy array "
                          "of dtype %s, or "
                          '2) set "allow_input_downcast=True" when calling '
                          '"function".'
                          % (self, data, converted_data, self.dtype)
                      )
                      raise TypeError(err_msg, data)
  
      if self.ndim != data.ndim:
          raise TypeError(
              "Wrong number of dimensions: expected %s,"
              " got %s with shape %s."
              % (self.ndim, data.ndim, data.shape)
          )
      if not data.flags.aligned:
          try:
              msg = "object buffer" + str(data.data)
          except AttributeError:
              msg = ""
          raise TypeError(
              "The numpy.ndarray object is not aligned."
              " Theano C code does not support that.",
              msg,
              "object shape",
              data.shape,
              "object strides",
              data.strides,
              "object dtype",
              data.dtype,
          )
  
      i = 0
      for b in self.broadcastable:
          if b and data.shape[i] != 1:
              raise TypeError(
                  "Non-unit value on shape on a broadcastable"
                  " dimension.",
                  data.shape,
                  self.broadcastable,
              )
          i += 1
      if self.filter_checks_isfinite and not np.all(np.isfinite(data)):
          raise ValueError("non-finite elements not allowed")
      return data
  
imports: from __future__ import absolute_import, print_function, division
  import logging
  import warnings
  import numpy
  import theano
  from theano import config
  from theano.gof import hashtype, Type, Variable
  from theano import scalar
label_desc: Use image node_id 3 for calling the TensorType obj's underlying member method code with example usage: obj.filter(data, strict, allow_downcast) and returns: data