identity

class mfai.pytorch.models.identity.IdentityModel(*args, **kwargs)[source]

Bases: BaseModel

Implementation of an identity model. Its forward method returns the input tensor.

Parameters:
features_last = False
forward(x)[source]

Return the input torch.Tensor without any changes.

Return type:

Tensor

Parameters:

x (Tensor)

model_type = 7
num_spatial_dims: int = 2
onnx_supported = False
register: bool = True
settings = None
settings_kls

alias of IdentityModelSettings

supported_num_spatial_dims = (2, 3)
class mfai.pytorch.models.identity.IdentityModelSettings[source]

Bases: object

Empty dataclass because IdentityModel has no parameters.

classmethod from_dict(kvs, *, infer_missing=False)
Return type:

TypeVar(A, bound= DataClassJsonMixin)

Parameters:

kvs (dict | list | str | int | float | bool | None)

classmethod from_json(s, *, parse_float=None, parse_int=None, parse_constant=None, infer_missing=False, **kw)
Return type:

TypeVar(A, bound= DataClassJsonMixin)

Parameters:

s (str | bytes | bytearray)

classmethod schema(*, infer_missing=False, only=None, exclude=(), many=False, context=None, load_only=(), dump_only=(), partial=False, unknown=None)
Return type:

SchemaF[TypeVar(A, bound= DataClassJsonMixin)]

Parameters:
to_dict(encode_json=False)
Return type:

Dict[str, Union[dict, list, str, int, float, bool, None]]

to_json(*, skipkeys=False, ensure_ascii=True, check_circular=True, allow_nan=True, indent=None, separators=None, default=None, sort_keys=False, **kw)
Return type:

str

Parameters: