Applies a module method to variables and returns output and modified variables.
(
self,
variables: VariableDict,
tokens: Int['*B L'],
*,
images: UInt8['*B N H W C'] | UInt8['*B H W C'] | None = None,
cache: _config.Cache | None = None,
positions: Int['*B L_with_mm'] | None = None,
attention_mask: Bool['*B L_with_mm cache_length'] | None = None,
)
| 132 | @typechecked |
| 133 | @abc.abstractmethod |
| 134 | def apply( |
| 135 | self, |
| 136 | variables: VariableDict, |
| 137 | tokens: Int['*B L'], |
| 138 | *, |
| 139 | images: UInt8['*B N H W C'] | UInt8['*B H W C'] | None = None, |
| 140 | cache: _config.Cache | None = None, |
| 141 | positions: Int['*B L_with_mm'] | None = None, |
| 142 | attention_mask: Bool['*B L_with_mm cache_length'] | None = None, |
| 143 | ) -> Any | tuple[Any, FrozenVariableDict | dict[str, Any]]: |
| 144 | """Applies a module method to variables and returns output and modified variables.""" |
| 145 | ... |
| 146 | |
| 147 | @typechecked |
| 148 | @abc.abstractmethod |
no outgoing calls