Open3D (C++ API)
0.19.0
Toggle main menu visibility
Loading...
Searching...
No Matches
cpp
open3d
core
TensorKey.h
Go to the documentation of this file.
1
// ----------------------------------------------------------------------------
2
// - Open3D: www.open3d.org -
3
// ----------------------------------------------------------------------------
4
// Copyright (c) 2018-2024 www.open3d.org
5
// SPDX-License-Identifier: MIT
6
// ----------------------------------------------------------------------------
7
8
#pragma once
9
10
#include "
open3d/utility/Logging.h
"
11
#include "
open3d/utility/Optional.h
"
12
13
namespace
open3d
{
14
namespace
core
{
15
16
// Avoids circular include.
17
class
Tensor
;
18
19
// Same as utility::nullopt. Provides a similar Python slicing API.
20
constexpr
utility::nullopt_t
None
{
utility::nullopt_t::init
()};
21
26
class
TensorKey {
27
public
:
37
static
TensorKey
Index
(int64_t index);
38
50
static
TensorKey
Slice
(
utility::optional<int64_t>
start,
51
utility::optional<int64_t>
stop,
52
utility::optional<int64_t>
step);
53
65
static
TensorKey
IndexTensor
(
const
Tensor
& index_tensor);
66
67
enum class
TensorKeyMode
{
Index
,
Slice
,
IndexTensor
};
68
~TensorKey
() {}
69
71
TensorKeyMode
GetMode
()
const
;
72
74
std::string
ToString
()
const
;
75
76
public
:
79
int64_t
GetIndex
()
const
;
80
83
int64_t
GetStart
()
const
;
84
87
int64_t
GetStop
()
const
;
88
91
int64_t
GetStep
()
const
;
92
104
TensorKey
InstantiateDimSize
(int64_t dim_size)
const
;
105
108
Tensor
GetIndexTensor
()
const
;
109
110
private
:
111
class
Impl;
112
class
IndexImpl;
113
class
SliceImpl;
114
class
IndexTensorImpl;
115
std::shared_ptr<Impl> impl_;
116
TensorKey
(
const
std::shared_ptr<Impl>& impl);
117
};
118
119
}
// namespace core
120
}
// namespace open3d
Logging.h
Optional.h
open3d::core::Tensor
Definition
Tensor.h:32
open3d::core::TensorKey
TensorKey is used to represent single index, slice or advanced indexing on a Tensor.
Definition
TensorKey.h:26
open3d::core::TensorKey::GetStart
int64_t GetStart() const
Definition
TensorKey.cpp:155
open3d::core::TensorKey::ToString
std::string ToString() const
Convert TensorKey to a string representation.
Definition
TensorKey.cpp:131
open3d::core::TensorKey::Index
static TensorKey Index(int64_t index)
Definition
TensorKey.cpp:133
open3d::core::TensorKey::GetIndex
int64_t GetIndex() const
Definition
TensorKey.cpp:147
open3d::core::TensorKey::GetIndexTensor
Tensor GetIndexTensor() const
Definition
TensorKey.cpp:185
open3d::core::TensorKey::GetStop
int64_t GetStop() const
Definition
TensorKey.cpp:162
open3d::core::TensorKey::Slice
static TensorKey Slice(utility::optional< int64_t > start, utility::optional< int64_t > stop, utility::optional< int64_t > step)
Definition
TensorKey.cpp:137
open3d::core::TensorKey::TensorKeyMode
TensorKeyMode
Definition
TensorKey.h:67
open3d::core::TensorKey::GetMode
TensorKeyMode GetMode() const
Returns TensorKey mode.
Definition
TensorKey.cpp:129
open3d::core::TensorKey::IndexTensor
static TensorKey IndexTensor(const Tensor &index_tensor)
Definition
TensorKey.cpp:143
open3d::core::TensorKey::~TensorKey
~TensorKey()
Definition
TensorKey.h:68
open3d::core::TensorKey::InstantiateDimSize
TensorKey InstantiateDimSize(int64_t dim_size) const
Definition
TensorKey.cpp:176
open3d::core::TensorKey::GetStep
int64_t GetStep() const
Definition
TensorKey.cpp:169
open3d::utility::optional
Definition
Optional.h:259
open3d::core
Definition
AdvancedIndexing.cpp:15
open3d::core::None
constexpr utility::nullopt_t None
Definition
TensorKey.h:20
open3d
Definition
PinholeCameraIntrinsic.cpp:16
open3d::utility::nullopt_t::init
Definition
Optional.h:149
open3d::utility::nullopt_t
Definition
Optional.h:148
Generated by
1.17.0