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: Determine if another `Type` represents a subset from the same "class" of types represented by `self`.
  
  A "class" of types could be something like "float64 tensors with four
  dimensions".  One `Type` could represent a set containing only a type
  for "float64 tensors with shape (1, 2, 3, 4)" and another the set of
  "float64 tensors with shape (1, x, x, x)" for all suitable "x".
  
  It's up to each subclass of `Type` to determine to which "classes" of types this
  method applies.
  
  The default implementation assumes that all "classes" have only one
  unique element (i.e. it uses `self.__eq__`).
docstr_tok: ["Determine","if","another","`","Type","`","represents","a","subset","from","the","same","``","class","''","of","types","represented","by","`","self","`",".","A","``","class","''","of","types","could","be","something","like","``","float64","tensors","with","four","dimensions","''",".","One","`","Type","`","could","represent","a","set","containing","only","a","type","for","``","float64","tensors","with","shape","(","1",",","2",",","3",",","4",")","''","and","another","the","set","of","''","float64","tensors","with","shape","(","1",",","x",",","x",",","x",")","''","for","all","suitable","``","x","''",".","It","'s","up","to","each","subclass","of","`","Type","`","to","determine","to","which","``","classes","''","of","types","this","method","applies",".","The","default","implementation","assumes","that","all","``","classes","''","have","only","one","unique","element","(","i.e",".","it","uses","`","self.__eq__","`",")","."]
code: def in_same_class(self, otype: "Type") -> Optional[bool]:
      """Determine if another `Type` represents a subset from the same "class" of types represented by `self`.
  
      A "class" of types could be something like "float64 tensors with four
      dimensions".  One `Type` could represent a set containing only a type
      for "float64 tensors with shape (1, 2, 3, 4)" and another the set of
      "float64 tensors with shape (1, x, x, x)" for all suitable "x".
  
      It's up to each subclass of `Type` to determine to which "classes" of types this
      method applies.
  
      The default implementation assumes that all "classes" have only one
      unique element (i.e. it uses `self.__eq__`).
  
      """
      if self == otype:
          return True
  
      return False
  
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 1 for calling the Type obj's underlying member method code with example usage: obj.in_same_class(otype) and returns: False, True