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 a symbolic Variable into a TensorType, if compatible.
  
  For the moment, only a TensorType and GpuArrayType will be
  converted, provided they have the same number of dimensions
  and dtype and have "compatible" broadcastable pattern.
docstr_tok: ["Convert","a","symbolic","Variable","into","a","TensorType",",","if","compatible",".","For","the","moment",",","only","a","TensorType","and","GpuArrayType","will","be","converted",",","provided","they","have","the","same","number","of","dimensions","and","dtype","and","have","``","compatible","''","broadcastable","pattern","."]
code: def filter_variable(self, other, allow_convert=True):
      """
      Convert a symbolic Variable into a TensorType, if compatible.
  
      For the moment, only a TensorType and GpuArrayType will be
      converted, provided they have the same number of dimensions
      and dtype and have "compatible" broadcastable pattern.
  
      """
      if hasattr(other, "_as_TensorVariable"):
          other = other._as_TensorVariable()
  
      if not isinstance(other, Variable):
          # The value is not a Variable: we cast it into
          # a Constant of the appropriate Type.
          other = self.Constant(type=self, data=other)
  
      if other.type == self:
          return other
  
      if allow_convert:
          # Attempt safe broadcast conversion.
          other2 = self.convert_variable(other)
          if other2 is not None and other2.type == self:
              return other2
  
      raise TypeError(
          "Cannot convert Type %(othertype)s "
          "(of Variable %(other)s) into Type %(self)s. "
          "You can try to manually convert %(other)s into a %(self)s."
          % dict(othertype=other.type, other=other, self=self)
      )
  
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 4 for calling the TensorType obj's underlying member method code with example usage: obj.filter_variable(other, allow_convert) and returns: other, other2