class_docstr: Interface specification for variable type instances.
  
  A :term:`Type` instance is mainly responsible for two things:
  
  - creating `Variable` instances (conventionally, `__call__` does this), and
  
  - filtering a value assigned to a `Variable` so that the value
    conforms to restrictions imposed by the type (also known as
    casting, this is done by `filter`).
class_docstr_tok: ["Interface","specification","for","variable","type","instances",".","A",":","term",":","`","Type","`","instance","is","mainly","responsible","for","two","things",":","-","creating","`","Variable","`","instances","(","conventionally",",","`","__call__","`","does","this",")",",","and","-","filtering","a","value","assigned","to","a","`","Variable","`","so","that","the","value","conforms","to","restrictions","imposed","by","the","type","(","also","known","as","casting",",","this","is","done","by","`","filter","`",")","."]
docstr: Return data or an appropriately wrapped/converted data.
  
  Subclass implementations should raise a TypeError exception if
  the data is not of an acceptable type.
  
  Parameters
  ----------
  data: array-like
      The data to be filtered/converted.
  strict: bool (optional)
      If ``True``, the data returned must be the same as the
      data passed as an argument.
  allow_downcast: bool (optional)
      If `strict` is ``False``, and `allow_downcast` is ``True``, the
      data may be cast to an appropriate type. If `allow_downcast` is
      ``False``, it may only be up-cast and not lose precision. If
      `allow_downcast` is ``None`` (default), the behaviour can be
      type-dependent, but for now it means only Python floats can be
      down-casted, and only to floatX scalars.
docstr_tok: ["Return","data","or","an","appropriately","wrapped\/converted","data",".","Subclass","implementations","should","raise","a","TypeError","exception","if","the","data","is","not","of","an","acceptable","type",".","Parameters","--","--","--","--","--","data",":","array-like","The","data","to","be","filtered\/converted",".","strict",":","bool","(","optional",")","If","``","True","``",",","the","data","returned","must","be","the","same","as","the","data","passed","as","an","argument",".","allow_downcast",":","bool","(","optional",")","If","`","strict","`","is","``","False","``",",","and","`","allow_downcast","`","is","``","True","``",",","the","data","may","be","cast","to","an","appropriate","type",".","If","`","allow_downcast","`","is","``","False","``",",","it","may","only","be","up-cast","and","not","lose","precision",".","If","`","allow_downcast","`","is","``","None","``","(","default",")",",","the","behaviour","can","be","type-dependent",",","but","for","now","it","means","only","Python","floats","can","be","down-casted",",","and","only","to","floatX","scalars","."]
code: def filter(
      self,
      data: Any,
      strict: bool = False,
      allow_downcast: Optional[bool] = None,
  ) -> D:
      """Return data or an appropriately wrapped/converted data.
  
      Subclass implementations should raise a TypeError exception if
      the data is not of an acceptable type.
  
      Parameters
      ----------
      data: array-like
          The data to be filtered/converted.
      strict: bool (optional)
          If ``True``, the data returned must be the same as the
          data passed as an argument.
      allow_downcast: bool (optional)
          If `strict` is ``False``, and `allow_downcast` is ``True``, the
          data may be cast to an appropriate type. If `allow_downcast` is
          ``False``, it may only be up-cast and not lose precision. If
          `allow_downcast` is ``None`` (default), the behaviour can be
          type-dependent, but for now it means only Python floats can be
          down-casted, and only to floatX scalars.
  
      """
  
imports: from abc import abstractmethod
  from typing import Any, Generic, Optional, TypeVar, Union
  from typing_extensions import TypeAlias
  from pytensor.graph import utils
  from pytensor.graph.basic import Constant, Variable
  from pytensor.graph.utils import MetaObject
label_desc: Use image node_id 3 for calling the Type obj's underlying member method code with example usage: obj.filter(data, strict, allow_downcast) without return types