Skip to main content
Version: 0.2.4

Module: torchlive/torch

Interfaces

Type aliases

Device

Ƭ Device: "cpu"

Allowed torch devices

https://pytorch.org/docs/1.12/tensor_attributes.html#torch-device


Dict

Ƭ Dict: Object

Index signature

[key: string]: IValue


Dtype

Ƭ Dtype: "double" | "float" | "float32" | "float64" | "int" | "int16" | "int32" | "int64" | "int8" | "long" | "short" | "uint8"

A Dtype is an object that represents the data type of a Tensor.

note

The int64 (a.k.a. long) data types are not fully supported in React Native. For now, use .to({dtype: torch.int32}) to downcast before accessing such methods as .data() and .item().

https://pytorch.org/docs/1.12/tensor_attributes.html#torch-dtype


ExtraFilesMap

Ƭ ExtraFilesMap: Object

Defining type for extra files loaded with torch.jit._loadForMobile and torch.jit._loadForMobileSync.

Index signature

[key: string]: string | null


IValue

Ƭ IValue: null | string | number | boolean | Tensor | Dict | IValue[]

The IValue type is a convenient type representative of all possible module input/output values.


MemoryFormat

Ƭ MemoryFormat: "channelsLast" | "contiguousFormat" | "preserveFormat"

A MemoryFormat is an object representing the memory format on which a Tensor is or will be allocated.

https://pytorch.org/docs/1.12/tensor_attributes.html#torch.torch.memory_format


Scalar

Ƭ Scalar: number


TensorOptions

Ƭ TensorOptions: Object

Type declaration

NameTypeDescription
dtype?DtypeThe desired data type of a tensor.

Variables

torch

Const torch: Torch