Skip to content

type_common

Attributes#

fastforward.type_common.IntOr2Tuple = ScalarOr2Tuple[int] module-attribute #

fastforward.type_common.IntOrTuple = ScalarOrTuple[int] module-attribute #

fastforward.type_common.ScalarOr2Tuple = T | tuple[T, T] module-attribute #

fastforward.type_common.ScalarOrTuple = T | tuple[T, ...] module-attribute #

fastforward.type_common.SizeT = torch.Size | tuple[int, ...] module-attribute #

fastforward.type_common.T = TypeVar('T') module-attribute #

fastforward.type_common.Tuple3 = tuple[T, T, T] module-attribute #

Classes#

fastforward.type_common.MethodType #

Bases: Enum


              flowchart TD
              fastforward.type_common.MethodType[MethodType]

              

              click fastforward.type_common.MethodType href "" "fastforward.type_common.MethodType"
            

Enumeration representing different types of methods in a class.

Attributes:

Name Type Description
METHOD

Regular instance method that takes self as first parameter.

CLASS_METHOD

Class method decorated with @classmethod that takes cls as first parameter.

STATIC_METHOD

Static method decorated with @staticmethod that doesn't take self or cls.

NO_METHOD

Indicates that the class does not have a method with the specified name. Can also be used to indicate that a function reference is not a method.

Attributes#
CLASS_METHOD = enum.auto() class-attribute instance-attribute #
METHOD = enum.auto() class-attribute instance-attribute #
NO_METHOD = enum.auto() class-attribute instance-attribute #
STATIC_METHOD = enum.auto() class-attribute instance-attribute #

Functions#

fastforward.type_common.method_type(cls_or_module, method_name) #

Determine the type of a method in a class.

Parameters:

Name Type Description Default
cls_or_module type | ModuleType

The class or module to inspect.

required
method_name str

The name of the method to check.

required

Returns:

Type Description
MethodType

A MethodType enum value indicating the type of the method: