|
Open3D (C++ API)
0.19.0
|
TensorKey is used to represent single index, slice or advanced indexing on a Tensor. More...
#include <TensorKey.h>
Data Structures | |
| class | Impl |
| class | IndexImpl |
| class | SliceImpl |
| class | IndexTensorImpl |
Public Types | |
| enum class | TensorKeyMode { Index , Slice , IndexTensor } |
Public Member Functions | |
| ~TensorKey () | |
| TensorKeyMode | GetMode () const |
| Returns TensorKey mode. | |
| std::string | ToString () const |
| Convert TensorKey to a string representation. | |
| int64_t | GetIndex () const |
| int64_t | GetStart () const |
| int64_t | GetStop () const |
| int64_t | GetStep () const |
| TensorKey | InstantiateDimSize (int64_t dim_size) const |
| Tensor | GetIndexTensor () const |
Static Public Member Functions | |
| static TensorKey | Index (int64_t index) |
| static TensorKey | Slice (utility::optional< int64_t > start, utility::optional< int64_t > stop, utility::optional< int64_t > step) |
| static TensorKey | IndexTensor (const Tensor &index_tensor) |
TensorKey is used to represent single index, slice or advanced indexing on a Tensor.
See https://numpy.org/doc/stable/reference/arrays.indexing.html for details.
|
strong |
|
inline |
| int64_t open3d::core::TensorKey::GetIndex | ( | ) | const |
Get (single) index. For TensorKeyMode::Index only.
| Tensor open3d::core::TensorKey::GetIndexTensor | ( | ) | const |
Get advanced indexing tensor. For TensorKeyMode::IndexTensor only.
| TensorKey::TensorKeyMode open3d::core::TensorKey::GetMode | ( | ) | const |
Returns TensorKey mode.
| int64_t open3d::core::TensorKey::GetStart | ( | ) | const |
Get start index. Throws exception if start is None. For TensorKeyMode::Slice only.
| int64_t open3d::core::TensorKey::GetStep | ( | ) | const |
Get step index. Throws exception if step is None. For TensorKeyMode::Slice only.
| int64_t open3d::core::TensorKey::GetStop | ( | ) | const |
Get stop index. Throws exception if stop is None. For TensorKeyMode::Slice only.
|
static |
Instantiates a TensorKey with single index mode.
| index | Index to the tensor. |
|
static |
Instantiates a TensorKey with tensor-index (advanced indexing) mode.
| index_tensor | Indexing tensor of dtype int64_t or bool. |
| TensorKey open3d::core::TensorKey::InstantiateDimSize | ( | int64_t | dim_size | ) | const |
When dim_size is know, convert the None values in start, stop, step with to concrete values and returns a new TensorKey.
For TensorKeyMode::Slice only.
|
static |
Instantiates a TensorKey with slice mode.
| start | Start index. None means starting from the 0-th element. |
| stop | Stop index. None means stopping at the last element. |
| step | Step size. None means step size 1. |
| std::string open3d::core::TensorKey::ToString | ( | ) | const |
Convert TensorKey to a string representation.