torchrelay.jit
Overview
|
Indexing |
|
|
Convert linear indices into sub indices (i, j, k). |
|
|
Convert sub indices (i, j, k) into linear indices. |
|
|
Math |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Meshgrid |
|
|
Meshgrid with |
|
|
Meshgrid with |
|
|
Python objects |
|
|
Pad a list |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Cumulative product |
|
|
Tensors |
|
|
|
|
|
|
|
|
|
|
ind2sub
Convert linear indices into sub indices (i, j, k).
The rightmost dimension is the most rapidly changing one -> if shape == [D, H, W], the strides are therefore [H*W, W, 1]
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ind |
tensor_like
|
Linear indices |
required |
shape |
(D,) vector_like
|
Size of each dimension. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
subs |
(D, ...) tensor
|
Sub-indices. |
sub2ind
Convert sub indices (i, j, k) into linear indices.
The rightmost dimension is the most rapidly changing one -> if shape == [D, H, W], the strides are therefore [H*W, W, 1]
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
subs |
(D, ...) tensor
|
List of sub-indices. The first dimension is the number of dimension. Each element should have the same number of elements and shape. |
required |
shape |
(D,) list[int]
|
Size of each dimension. Its length should be the same as the
first dimension of |
required |
Returns:
| Name | Type | Description |
|---|---|---|
ind |
(...) tensor
|
Linear indices |
sub2ind_list
Convert sub indices (i, j, k) into linear indices.
The rightmost dimension is the most rapidly changing one -> if shape == [D, H, W], the strides are therefore [H*W, W, 1]
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
subs |
(D,) list[tensor]
|
List of sub-indices. The first dimension is the number of dimension. Each element should have the same number of elements and shape. |
required |
shape |
(D,) list[int]
|
Size of each dimension. Its length should be the same as the
first dimension of |
required |
Returns:
| Name | Type | Description |
|---|---|---|
ind |
(...) tensor
|
Linear indices |
cumprod_list_int
Cumulative product of elements in the list
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x |
list[int]
|
List of integers |
required |
reverse |
bool
|
Cumulative product from right to left. Else, cumulative product from left to right (default). |
False
|
exclusive |
bool
|
Start series from 1. Else start series from first element (default). |
False
|
Returns:
| Name | Type | Description |
|---|---|---|
y |
list[int]
|
Cumulative product |