Skip to main content
Version: Next

Interface: JIT

torchlive/torch.JIT

Methods

_loadForMobile

_loadForMobile<T>(filePath, device?, extraFiles?): Promise<T>

Loads a serialized mobile module.

Type parameters

NameType
TT: Module = Module

Parameters

NameTypeDescription
filePathstringPath to serialized mobile module.
device?"cpu"Device on which the model will be loaded.
extraFiles?ExtraFilesMapLoad extra files when loading the model.

Returns

Promise<T>

Serialized mobile module of the specified type extending Module, which, if not specified, default to be Module


_loadForMobileSync

_loadForMobileSync<T>(filePath, device?, extraFiles?): T

Loads a serialized mobile module synchronously.

Type parameters

NameType
TT: Module = Module

Parameters

NameTypeDescription
filePathstringPath to serialized mobile module.
device?"cpu"Device on which the model will be loaded.
extraFiles?ExtraFilesMapLoad extra files when loading the model.

Returns

T

Serialized mobile module of the specified type extending Module, which, if not specified, default to be Module