class_docstr: This class can create a struct of Theano types (like TensorType, GpuArrayType, etc.)
  to be used as a convenience op parameter wrapping many data.
  
  ParamsType constructor takes key-value args.
  Key will be the name of the attribute in the struct.
  Value is the Theano type of this attribute, ie. an instance of (a subclass of) :class:`Type`
  (eg. ``TensorType('int64', (False,))``).
  
  In a Python code any attribute named ``key`` will be available via::
  
      structObject.key
  
  In a C code, any attribute named ``key`` will be available via:
  
  .. code-block:: c
  
      structObject->key;
  
  .. note::
  
      This Type is not complete and should never be used for regular graph operations.
class_docstr_tok: ["This","class","can","create","a","struct","of","Theano","types","(","like","TensorType",",","GpuArrayType",",","etc",".",")","to","be","used","as","a","convenience","op","parameter","wrapping","many","data",".","ParamsType","constructor","takes","key-value","args",".","Key","will","be","the","name","of","the","attribute","in","the","struct",".","Value","is","the","Theano","type","of","this","attribute",",","ie",".","an","instance","of","(","a","subclass","of",")",":","class",":","`","Type","`","(","eg",".","``","TensorType","(","'int64","'",",","(","False",",",")",")","``",")",".","In","a","Python","code","any","attribute","named","``","key","``","will","be","available","via",":",":","structObject.key","In","a","C","code",",","any","attribute","named","``","key","``","will","be","available","via",":","..","code-block",":",":","c","structObject-",">","key",";","..","note",":",":","This","Type","is","not","complete","and","should","never","be","used","for","regular","graph","operations","."]
code: def __init__(self, **kwargs):
      if len(kwargs) == 0:
          raise ValueError("Cannot create ParamsType from empty data.")
  
      for attribute_name in kwargs:
          if (
              re.match("^[A-Za-z_][A-Za-z0-9_]*$", attribute_name)
              is None
          ):
              raise AttributeError(
                  'ParamsType: attribute "%s" should be a valid identifier.'
                  % attribute_name
              )
          if attribute_name in c_cpp_keywords:
              raise SyntaxError(
                  'ParamsType: "%s" is a potential C/C++ keyword and should not be used as attribute name.'
                  % attribute_name
              )
          type_instance = kwargs[attribute_name]
          type_name = type_instance.__class__.__name__
          if not isinstance(type_instance, Type):
              raise TypeError(
                  'ParamsType: attribute "%s" should inherit from Theano Type, got "%s".'
                  % (attribute_name, type_name)
              )
  
      self.length = len(kwargs)
      self.fields = tuple(sorted(kwargs.keys()))
      self.types = tuple(kwargs[field] for field in self.fields)
      self.name = self.generate_struct_name()
  
      self.__const_to_enum = {}
      self.__alias_to_enum = {}
      enum_types = [t for t in self.types if isinstance(t, EnumType)]
      if enum_types:
          # We don't want same enum names in different enum types.
          if sum(len(t) for t in enum_types) != len(
              set(k for t in enum_types for k in t)
          ):
              raise AttributeError(
                  "ParamsType: found different enum types with common constants names."
              )
          # We don't want same aliases in different enum types.
          if sum(len(t.aliases) for t in enum_types) != len(
              set(alias for t in enum_types for alias in t.aliases)
          ):
              raise AttributeError(
                  "ParamsType: found different enum types with common constants aliases."
              )
          # We don't want aliases that have same names as some constants.
          all_enums = {e for t in enum_types for e in t}
          all_aliases = {a for t in enum_types for a in t.aliases}
          if [a for a in all_aliases if a in all_enums]:
              raise AttributeError(
                  "ParamsType: found aliases that have same names as constants."
              )
          # We map each enum name to the enum type in which it is defined.
          # We will then use this dict to find enum value when looking for enum name in ParamsType object directly.
          self.__const_to_enum = {
              enum_name: enum_type
              for enum_type in enum_types
              for enum_name in enum_type
          }
          self.__alias_to_enum = {
              alias: enum_type
              for enum_type in enum_types
              for alias in enum_type.aliases
          }
  
imports: from __future__ import absolute_import, print_function, division
  import re
  import hashlib
  from theano.gof.utils import MethodNotDefined, c_cpp_keywords
  from theano.gof import Type, EnumType
label_desc: Use image node_id 1 to create a new ParamsType object from inherited base classes: Type with example: obj = ParamsType()