Open3D (C++ API)  0.17.0
Public Member Functions
RaggedTensor Struct Reference

#include <RaggedTensor.h>

Inheritance diagram for RaggedTensor:

Public Member Functions

 RaggedTensor ()
 
 RaggedTensor (torch::Tensor values, torch::Tensor row_splits)
 Constructor for creating RaggedTensor with values and row_splits. More...
 
c10::intrusive_ptr< RaggedTensorFromRowSplits (torch::Tensor values, torch::Tensor row_splits, bool validate=true) const
 
torch::Tensor GetValues () const
 Returns _values tensor. More...
 
torch::Tensor GetRowSplits () const
 Returns _row_splits tensor. More...
 
std::string ToString () const
 Returns string representation. More...
 
torch::Tensor GetItem (int key) const
 
int64_t Len () const
 
c10::intrusive_ptr< RaggedTensorClone () const
 Copy Tensor to the same device. More...
 
c10::intrusive_ptr< RaggedTensorConcat (c10::intrusive_ptr< RaggedTensor > r_tensor, int64_t axis) const
 
template<typename T >
c10::intrusive_ptr< RaggedTensorAdd (T value) const
 
template<typename T >
c10::intrusive_ptr< RaggedTensorAdd_ (T value)
 
template<typename T >
c10::intrusive_ptr< RaggedTensorSub (T value) const
 
template<typename T >
c10::intrusive_ptr< RaggedTensorSub_ (T value)
 
template<typename T >
c10::intrusive_ptr< RaggedTensorMul (T value) const
 
template<typename T >
c10::intrusive_ptr< RaggedTensorMul_ (T value)
 
template<typename T >
c10::intrusive_ptr< RaggedTensorDiv (T value) const
 
template<typename T >
c10::intrusive_ptr< RaggedTensorDiv_ (T value)
 
template<typename T >
c10::intrusive_ptr< RaggedTensorFloorDiv (T value) const
 
template<typename T >
c10::intrusive_ptr< RaggedTensorFloorDiv_ (T value)
 

Detailed Description

A RaggedTensor is a tensor with ragged dimensions, whose slice may have different lengths. We define a container for ragged tensor to support operations involving batches whose elements may have different shape.

Constructor & Destructor Documentation

◆ RaggedTensor() [1/2]

RaggedTensor::RaggedTensor ( )
inline

◆ RaggedTensor() [2/2]

RaggedTensor::RaggedTensor ( torch::Tensor  values,
torch::Tensor  row_splits 
)
inline

Constructor for creating RaggedTensor with values and row_splits.

Member Function Documentation

◆ Add()

template<typename T >
c10::intrusive_ptr<RaggedTensor> RaggedTensor::Add ( value) const
inline

◆ Add_()

template<typename T >
c10::intrusive_ptr<RaggedTensor> RaggedTensor::Add_ ( value)
inline

◆ Clone()

c10::intrusive_ptr< RaggedTensor > RaggedTensor::Clone ( ) const

Copy Tensor to the same device.

◆ Concat()

c10::intrusive_ptr< RaggedTensor > RaggedTensor::Concat ( c10::intrusive_ptr< RaggedTensor r_tensor,
int64_t  axis 
) const

◆ Div()

template<typename T >
c10::intrusive_ptr<RaggedTensor> RaggedTensor::Div ( value) const
inline

◆ Div_()

template<typename T >
c10::intrusive_ptr<RaggedTensor> RaggedTensor::Div_ ( value)
inline

◆ FloorDiv()

template<typename T >
c10::intrusive_ptr<RaggedTensor> RaggedTensor::FloorDiv ( value) const
inline

◆ FloorDiv_()

template<typename T >
c10::intrusive_ptr<RaggedTensor> RaggedTensor::FloorDiv_ ( value)
inline

◆ FromRowSplits()

c10::intrusive_ptr< RaggedTensor > RaggedTensor::FromRowSplits ( torch::Tensor  values,
torch::Tensor  row_splits,
bool  validate = true 
) const

Creates a RaggedTensor with rows partitioned by row_splits.

The returned RaggedTensor corresponds with the python list defined by:

result = [values[row_splits[i]:row_splits[i + 1]]
for i in range(len(row_splits) - 1)]

◆ GetItem()

torch::Tensor RaggedTensor::GetItem ( int  key) const

Pythonic getitem for RaggedTensor.

Returns a slice of values based on row_splits. It can be used to retrieve i'th batch element. Currently it only supports a single integer index.

◆ GetRowSplits()

torch::Tensor RaggedTensor::GetRowSplits ( ) const

Returns _row_splits tensor.

◆ GetValues()

torch::Tensor RaggedTensor::GetValues ( ) const

Returns _values tensor.

◆ Len()

int64_t RaggedTensor::Len ( ) const

Pythonic len for RaggedTensor.

Returns number of batch elements.

◆ Mul()

template<typename T >
c10::intrusive_ptr<RaggedTensor> RaggedTensor::Mul ( value) const
inline

◆ Mul_()

template<typename T >
c10::intrusive_ptr<RaggedTensor> RaggedTensor::Mul_ ( value)
inline

◆ Sub()

template<typename T >
c10::intrusive_ptr<RaggedTensor> RaggedTensor::Sub ( value) const
inline

◆ Sub_()

template<typename T >
c10::intrusive_ptr<RaggedTensor> RaggedTensor::Sub_ ( value)
inline

◆ ToString()

std::string RaggedTensor::ToString ( ) const

Returns string representation.


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