Open3D (C++ API)
Public Member Functions | Protected Attributes
open3d::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}, Dtype::Float32);
for (int64_t i = 0; i < iter.NumWorkloads(); ++i) {
*static_cast<float*>(iter.GetPtr(i)) = 100.f;
}

Constructor & Destructor Documentation

◆ TensorIterator()

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

Member Function Documentation

◆ GetPtr()

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

◆ NumWorkloads()

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

Field Documentation

◆ input_

TensorRef open3d::TensorIterator::input_
protected

◆ ndims_

int64_t open3d::TensorIterator::ndims_
protected

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