LArSoft
v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
|
#include "TritonData.h"
Public Types | |
using | Result = nic::InferResult |
using | TensorMetadata = inference::ModelMetadataResponse_TensorMetadata |
using | ShapeType = std::vector< int64_t > |
using | ShapeView = triton_span::Span< ShapeType::const_iterator > |
Public Member Functions | |
TritonData (const std::string &name, const TensorMetadata &model_info, bool noBatch) | |
bool | setShape (const ShapeType &newShape) |
bool | setShape (unsigned loc, int64_t val) |
template<typename DT > | |
void | toServer (std::shared_ptr< TritonInput< DT >> ptr) |
template<typename DT > | |
TritonOutput< DT > | fromServer () const |
const ShapeView & | shape () const |
int64_t | byteSize () const |
const std::string & | dname () const |
unsigned | batchSize () const |
bool | variableDims () const |
int64_t | sizeDims () const |
int64_t | sizeShape () const |
Private Member Functions | |
bool | setShape (const ShapeType &newShape, bool canThrow) |
bool | setShape (unsigned loc, int64_t val, bool canThrow) |
void | setBatchSize (unsigned bsize) |
void | reset () |
void | setResult (std::shared_ptr< Result > result) |
IO * | data () |
bool | anyNeg (const ShapeView &vec) const |
int64_t | dimProduct (const ShapeView &vec) const |
void | createObject (IO **ioptr) const |
Private Attributes | |
std::string | name_ |
std::shared_ptr< IO > | data_ |
const ShapeType | dims_ |
bool | noBatch_ |
unsigned | batchSize_ |
ShapeType | fullShape_ |
ShapeView | shape_ |
bool | variableDims_ |
int64_t | productDims_ |
std::string | dname_ |
inference::DataType | dtype_ |
int64_t | byteSize_ |
std::any | holder_ |
std::shared_ptr< Result > | result_ |
Friends | |
class | TritonClient |
Definition at line 32 of file TritonData.h.
using lartriton::TritonData< IO >::Result = nic::InferResult |
Definition at line 34 of file TritonData.h.
using lartriton::TritonData< IO >::ShapeType = std::vector<int64_t> |
Definition at line 36 of file TritonData.h.
using lartriton::TritonData< IO >::ShapeView = triton_span::Span<ShapeType::const_iterator> |
Definition at line 37 of file TritonData.h.
using lartriton::TritonData< IO >::TensorMetadata = inference::ModelMetadataResponse_TensorMetadata |
Definition at line 35 of file TritonData.h.
lartriton::TritonData< IO >::TritonData | ( | const std::string & | name, |
const TensorMetadata & | model_info, | ||
bool | noBatch | ||
) |
Definition at line 18 of file TritonData.cc.
References lartriton::TritonData< IO >::createObject(), lartriton::TritonData< IO >::data_, lartriton::TritonData< IO >::dname_, lartriton::TritonData< IO >::fullShape_, lartriton::TritonData< IO >::name_, and lartriton::TritonData< IO >::setShape().
|
inlineprivate |
Definition at line 76 of file TritonData.h.
References triton_span::Span< T >::begin(), and triton_span::Span< T >::end().
|
inline |
|
inline |
|
private |
Referenced by lartriton::TritonData< IO >::dimProduct(), and lartriton::TritonData< IO >::TritonData().
|
inlineprivate |
|
inlineprivate |
Definition at line 80 of file TritonData.h.
References triton_span::Span< T >::begin(), lartriton::TritonData< IO >::createObject(), and triton_span::Span< T >::end().
Referenced by lartriton::TritonData< IO >::sizeShape().
|
inline |
TritonOutput< DT > lartriton::TritonOutputData::fromServer | ( | ) | const |
Definition at line 143 of file TritonData.cc.
References lartriton::TritonData< IO >::batchSize_, lartriton::TritonData< IO >::byteSize_, lartriton::TritonData< IO >::dname_, lartriton::TritonData< IO >::name_, lartriton::TritonData< IO >::result_, lartriton::TritonData< IO >::sizeShape(), and triton_utils::throwIfError().
Referenced by lartriton::TritonData< IO >::reset(), and lartriton::TritonData< IO >::setShape().
|
private |
Definition at line 179 of file TritonData.cc.
References lartriton::TritonData< IO >::data_, lartriton::TritonData< IO >::fromServer(), lartriton::TritonData< IO >::holder_, lartriton::TritonData< IO >::result_, and lartriton::TritonData< IO >::toServer().
|
private |
Definition at line 101 of file TritonData.cc.
References lartriton::TritonData< IO >::batchSize_, lartriton::TritonData< IO >::fullShape_, and lartriton::TritonData< IO >::noBatch_.
|
inlineprivate |
|
inline |
Definition at line 43 of file TritonData.h.
References lartriton::TritonData< IO >::setShape().
Referenced by lartriton::TritonData< IO >::setShape(), and lartriton::TritonData< IO >::TritonData().
|
inline |
Definition at line 44 of file TritonData.h.
References lartriton::TritonData< IO >::fromServer(), lartriton::TritonData< IO >::setShape(), and lartriton::TritonData< IO >::toServer().
Referenced by lartriton::TritonData< IO >::setShape().
|
private |
|
private |
Definition at line 63 of file TritonData.cc.
References lartriton::TritonData< IO >::dims_, lartriton::TritonData< IO >::fullShape_, MF_LOG_WARNING, lartriton::TritonData< IO >::name_, and lartriton::TritonData< IO >::noBatch_.
|
inline |
|
inline |
Definition at line 60 of file TritonData.h.
References lartriton::TritonData< IO >::productDims_.
Referenced by lartriton::TritonData< IO >::sizeShape().
|
inline |
Definition at line 62 of file TritonData.h.
References lartriton::TritonData< IO >::dimProduct(), lartriton::TritonData< IO >::shape_, lartriton::TritonData< IO >::sizeDims(), and lartriton::TritonData< IO >::variableDims_.
Referenced by lartriton::TritonData< IO >::fromServer(), and lartriton::TritonData< IO >::toServer().
void lartriton::TritonInputData::toServer | ( | std::shared_ptr< TritonInput< DT >> | ptr | ) |
Definition at line 110 of file TritonData.cc.
References lartriton::TritonData< IO >::batchSize_, lartriton::TritonData< IO >::byteSize_, lartriton::TritonData< IO >::data_, lartriton::TritonData< IO >::dname_, lartriton::TritonData< IO >::fullShape_, lartriton::TritonData< IO >::holder_, lartriton::TritonData< IO >::name_, lartriton::TritonData< IO >::sizeShape(), triton_utils::throwIfError(), and util::to_string().
Referenced by lartriton::TritonData< IO >::reset(), and lartriton::TritonData< IO >::setShape().
|
inline |
|
friend |
Definition at line 65 of file TritonData.h.
|
private |
Definition at line 91 of file TritonData.h.
Referenced by lartriton::TritonData< IO >::batchSize(), lartriton::TritonData< IO >::fromServer(), lartriton::TritonData< IO >::setBatchSize(), and lartriton::TritonData< IO >::toServer().
|
private |
Definition at line 98 of file TritonData.h.
Referenced by lartriton::TritonData< IO >::byteSize(), lartriton::TritonData< IO >::fromServer(), and lartriton::TritonData< IO >::toServer().
|
private |
Definition at line 88 of file TritonData.h.
Referenced by lartriton::TritonData< IO >::data(), lartriton::TritonData< IO >::reset(), lartriton::TritonData< IO >::toServer(), and lartriton::TritonData< IO >::TritonData().
|
private |
Definition at line 89 of file TritonData.h.
Referenced by lartriton::TritonData< IO >::setShape().
|
private |
Definition at line 96 of file TritonData.h.
Referenced by lartriton::TritonData< IO >::dname(), lartriton::TritonData< IO >::fromServer(), lartriton::TritonData< IO >::toServer(), and lartriton::TritonData< IO >::TritonData().
|
private |
Definition at line 97 of file TritonData.h.
|
private |
Definition at line 92 of file TritonData.h.
Referenced by lartriton::TritonData< IO >::setBatchSize(), lartriton::TritonData< IO >::setShape(), lartriton::TritonData< IO >::toServer(), and lartriton::TritonData< IO >::TritonData().
|
private |
Definition at line 99 of file TritonData.h.
Referenced by lartriton::TritonData< IO >::reset(), and lartriton::TritonData< IO >::toServer().
|
private |
Definition at line 87 of file TritonData.h.
Referenced by lartriton::TritonData< IO >::fromServer(), lartriton::TritonData< IO >::setShape(), lartriton::TritonData< IO >::toServer(), and lartriton::TritonData< IO >::TritonData().
|
private |
Definition at line 90 of file TritonData.h.
Referenced by lartriton::TritonData< IO >::setBatchSize(), and lartriton::TritonData< IO >::setShape().
|
private |
Definition at line 95 of file TritonData.h.
Referenced by lartriton::TritonData< IO >::sizeDims().
|
private |
Definition at line 100 of file TritonData.h.
Referenced by lartriton::TritonData< IO >::fromServer(), lartriton::TritonData< IO >::reset(), and lartriton::TritonData< IO >::setResult().
|
private |
Definition at line 93 of file TritonData.h.
Referenced by lartriton::TritonData< IO >::shape(), and lartriton::TritonData< IO >::sizeShape().
|
private |
Definition at line 94 of file TritonData.h.
Referenced by lartriton::TritonData< IO >::sizeShape(), and lartriton::TritonData< IO >::variableDims().