core.transformer.identity_op#
Module Contents#
Classes#
This is a placeholder for IdentityOp(x) -> x |
|
This is a placeholder for IdentityFuncOp(…)(x) -> IdentityOp(x) -> x.
Such a func is handy for ops like |
Data#
API#
- core.transformer.identity_op.T#
‘TypeVar(…)’
- class core.transformer.identity_op.IdentityOp(*args: object, **kwargs: object)#
Bases:
torch.nn.ModuleThis is a placeholder for IdentityOp(x) -> x
Initialization
- forward(
- x: core.transformer.identity_op.T,
- *args: object,
- **kwargs: object,
Forward pass.
Returns x unchanged.
- class core.transformer.identity_op.IdentityFuncOp(*args: object, **kwargs: object)#
Bases:
core.transformer.identity_op.IdentityOpThis is a placeholder for IdentityFuncOp(…)(x) -> IdentityOp(x) -> x. Such a func is handy for ops like
bias_dropout_fusionwhich themselves return a function at runtime based on passed argumentsInitialization
- forward(*args: object, **kwargs: object)#
Forward pass.
Returns a function which returns its first argument unchanged, and discards all others.