Module: torchlive/torch
Interfaces
Type aliases
Device
Ƭ Device: "cpu"
Allowed torch devices
https://pytorch.org/docs/1.12/tensor_attributes.html#torch-device
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.
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
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
Name | Type | Description |
---|---|---|
dtype? | Dtype | The desired data type of a tensor. |
Variables
torch
• Const
torch: Torch