Open3D (C++ API)  0.12.0
Public Member Functions
open3d::t::geometry::TensorMap Class Reference

#include <TensorMap.h>

Inheritance diagram for open3d::t::geometry::TensorMap:

Public Member Functions

 TensorMap (const std::string &primary_key)
 Create empty TensorMap and set primary key. More...
 
 TensorMap ()
 
template<class InputIt >
 TensorMap (const std::string &primary_key, InputIt first, InputIt last)
 
 TensorMap (const std::string &primary_key, const std::unordered_map< std::string, core::Tensor > &tensor_map)
 
 TensorMap (const std::string &primary_key, std::initializer_list< value_type > init)
 
 TensorMap (const TensorMap &other)
 Copy constructor performs a "shallow" copy of the Tensors. More...
 
 TensorMap (TensorMap &&other)
 Move constructor performs a "shallow" copy of the Tensors. More...
 
TensorMapoperator= (const TensorMap &)=default
 
TensorMapoperator= (TensorMap &&)=default
 
std::string GetPrimaryKey () const
 Returns the primary key of the TensorMap. More...
 
bool IsSizeSynchronized () const
 Returns true if all tensors in the map have the same size. More...
 
void AssertSizeSynchronized () const
 Assert IsSizeSynchronized(). More...
 
bool Contains (const std::string &key) const
 

Detailed Description

TensorMap is a unordered_map<string, Tensor> with a primary key. It is typically used as a container for geometry attributes.

e.g. tensor_map.primary_key: "points" tensor_map["points"] : Tensor of shape {100, 3}. tensor_map["colors"] : Tensor of shape {100, 3}. tensor_map["normals"] : Tensor of shape {100, 3}.

Typically, tensors in the TensorMap should have the same length (the first dimension of shape) and device as the primary tensor.

Constructor & Destructor Documentation

◆ TensorMap() [1/7]

open3d::t::geometry::TensorMap::TensorMap ( const std::string &  primary_key)
inlineexplicit

Create empty TensorMap and set primary key.

◆ TensorMap() [2/7]

open3d::t::geometry::TensorMap::TensorMap ( )
inlineexplicit

A primary key is always required. This constructor can be marked as delete in C++, but it is needed for pybind to bind as a generic python map interface.

◆ TensorMap() [3/7]

template<class InputIt >
open3d::t::geometry::TensorMap::TensorMap ( const std::string &  primary_key,
InputIt  first,
InputIt  last 
)
inline

◆ TensorMap() [4/7]

open3d::t::geometry::TensorMap::TensorMap ( const std::string &  primary_key,
const std::unordered_map< std::string, core::Tensor > &  tensor_map 
)
inline

◆ TensorMap() [5/7]

open3d::t::geometry::TensorMap::TensorMap ( const std::string &  primary_key,
std::initializer_list< value_type >  init 
)
inline

◆ TensorMap() [6/7]

open3d::t::geometry::TensorMap::TensorMap ( const TensorMap other)
inline

Copy constructor performs a "shallow" copy of the Tensors.

◆ TensorMap() [7/7]

open3d::t::geometry::TensorMap::TensorMap ( TensorMap &&  other)
inline

Move constructor performs a "shallow" copy of the Tensors.

Member Function Documentation

◆ AssertSizeSynchronized()

void open3d::t::geometry::TensorMap::AssertSizeSynchronized ( ) const

◆ Contains()

bool open3d::t::geometry::TensorMap::Contains ( const std::string &  key) const
inline

Returns true if the key exists in the map. Same as C++20's std::unordered_map::contains().

◆ GetPrimaryKey()

std::string open3d::t::geometry::TensorMap::GetPrimaryKey ( ) const
inline

Returns the primary key of the TensorMap.

◆ IsSizeSynchronized()

bool open3d::t::geometry::TensorMap::IsSizeSynchronized ( ) const

Returns true if all tensors in the map have the same size.

◆ operator=() [1/2]

TensorMap& open3d::t::geometry::TensorMap::operator= ( const TensorMap )
default

◆ operator=() [2/2]

TensorMap& open3d::t::geometry::TensorMap::operator= ( TensorMap &&  )
default

The documentation for this class was generated from the following files: