ONNX Runtime
Loading...
Searching...
No Matches
Ort::ShapeInferContext Struct Reference

Provide access to per-node attributes and input shapes, so one could compute and set output shapes. More...

#include <onnxruntime_cxx_api.h>

Classes

struct  SymbolicInteger
 

Public Types

using Shape = std::vector< SymbolicInteger >
 
using Ints = std::vector< int64_t >
 
using Floats = std::vector< float >
 
using Strings = std::vector< std::string >
 

Public Member Functions

 ShapeInferContext (const OrtApi *ort_api, OrtShapeInferContext *ctx)
 
const ShapeGetInputShape (size_t indice) const
 
size_t GetInputCount () const
 
Status SetOutputShape (size_t indice, const Shape &shape, ONNXTensorElementDataType type=ONNX_TENSOR_ELEMENT_DATA_TYPE_FLOAT)
 
int64_t GetAttrInt (const char *attr_name)
 
Ints GetAttrInts (const char *attr_name)
 
float GetAttrFloat (const char *attr_name)
 
Floats GetAttrFloats (const char *attr_name)
 
std::string GetAttrString (const char *attr_name)
 
Strings GetAttrStrings (const char *attr_name)
 

Detailed Description

Provide access to per-node attributes and input shapes, so one could compute and set output shapes.

Member Typedef Documentation

◆ Floats

using Ort::ShapeInferContext::Floats = std::vector<float>

◆ Ints

using Ort::ShapeInferContext::Ints = std::vector<int64_t>

◆ Shape

◆ Strings

using Ort::ShapeInferContext::Strings = std::vector<std::string>

Constructor & Destructor Documentation

◆ ShapeInferContext()

Ort::ShapeInferContext::ShapeInferContext ( const OrtApi ort_api,
OrtShapeInferContext ctx 
)

Member Function Documentation

◆ GetAttrFloat()

float Ort::ShapeInferContext::GetAttrFloat ( const char *  attr_name)

◆ GetAttrFloats()

Floats Ort::ShapeInferContext::GetAttrFloats ( const char *  attr_name)

◆ GetAttrInt()

int64_t Ort::ShapeInferContext::GetAttrInt ( const char *  attr_name)

◆ GetAttrInts()

Ints Ort::ShapeInferContext::GetAttrInts ( const char *  attr_name)

◆ GetAttrString()

std::string Ort::ShapeInferContext::GetAttrString ( const char *  attr_name)

◆ GetAttrStrings()

Strings Ort::ShapeInferContext::GetAttrStrings ( const char *  attr_name)

◆ GetInputCount()

size_t Ort::ShapeInferContext::GetInputCount ( ) const
inline

◆ GetInputShape()

const Shape & Ort::ShapeInferContext::GetInputShape ( size_t  indice) const
inline

◆ SetOutputShape()

Status Ort::ShapeInferContext::SetOutputShape ( size_t  indice,
const Shape shape,
ONNXTensorElementDataType  type = ONNX_TENSOR_ELEMENT_DATA_TYPE_FLOAT 
)