Open3D (C++ API)  0.18.0+5c982c7
Public Member Functions | Protected Attributes
open3d::core::TensorIterator Class Reference

#include <Indexer.h>

Public Member Functions

 TensorIterator (const Tensor &tensor)
 
OPEN3D_HOST_DEVICE int64_t NumWorkloads () const
 
OPEN3D_HOST_DEVICE void * GetPtr (int64_t workload_idx) const
 

Protected Attributes

TensorRef input_
 
int64_t ndims_
 

Detailed Description

Indexer to one Tensor

Example usage:

// Create a float Tensor and set all elements to 100.
std::vector<float> vals{0, 1, 2, 3, 4};
Tensor a(vals, SizeVector{5}, core::Float32);
for (int64_t i = 0; i < iter.NumWorkloads(); ++i) {
*static_cast<float*>(iter.GetPtr(i)) = 100.f;
}
TensorIterator(const Tensor &tensor)
Definition: Indexer.h:223
const Dtype Float32
Definition: Dtype.cpp:42

Constructor & Destructor Documentation

◆ TensorIterator()

open3d::core::TensorIterator::TensorIterator ( const Tensor tensor)
inline

Member Function Documentation

◆ GetPtr()

OPEN3D_HOST_DEVICE void* open3d::core::TensorIterator::GetPtr ( int64_t  workload_idx) const
inline

◆ NumWorkloads()

OPEN3D_HOST_DEVICE int64_t open3d::core::TensorIterator::NumWorkloads ( ) const
inline

Field Documentation

◆ input_

TensorRef open3d::core::TensorIterator::input_
protected

◆ ndims_

int64_t open3d::core::TensorIterator::ndims_
protected

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