# OnnxRuntime: Ort::CustomOpConfigs Struct Reference

Loading...
Searching...
No Matches
Ort::CustomOpConfigs Struct Reference

Class that represents session configuration entries for one or more custom operators. More...

`#include <onnxruntime_cxx_api.h>`

## Public Member Functions

| CustomOpConfigs ()=default
| ~CustomOpConfigs ()=default
| CustomOpConfigs (const CustomOpConfigs &)=default
CustomOpConfigs & | operator= (const CustomOpConfigs &)=default
| CustomOpConfigs (CustomOpConfigs &&o)=default
CustomOpConfigs & | operator= (CustomOpConfigs &&o)=default
CustomOpConfigs & | AddConfig (const char *custom_op_name, const char *config_key, const char *config_value)
| Adds a session configuration entry/value for a specific custom operator.
const std::unordered_map< std::string, std::string > & | GetFlattenedConfigs () const
| Returns a flattened map of custom operator configuration entries and their values.

## Detailed Description

Class that represents session configuration entries for one or more custom operators.

Example: Ort::CustomOpConfigs op_configs; op_configs.AddConfig("my_custom_op", "device_type", "CPU");

Passed to Ort::SessionOptions::RegisterCustomOpsLibrary.

## Constructor & Destructor Documentation

## CustomOpConfigs() [1/3]

Ort::CustomOpConfigs::CustomOpConfigs | ( |  | ) |

default

## ~CustomOpConfigs()

Ort::CustomOpConfigs::~CustomOpConfigs | ( |  | ) |

default

## CustomOpConfigs() [2/3]

Ort::CustomOpConfigs::CustomOpConfigs | ( | const CustomOpConfigs & |  | ) |

default

## CustomOpConfigs() [3/3]

Ort::CustomOpConfigs::CustomOpConfigs | ( | CustomOpConfigs && | o | ) |

default

## Member Function Documentation

## AddConfig()

CustomOpConfigs & Ort::CustomOpConfigs::AddConfig | ( | const char * | custom_op_name,
|  | const char * | config_key,
|  | const char * | config_value
| ) |  |

Adds a session configuration entry/value for a specific custom operator.

Parameters

  custom_op_name | The name of the custom operator for which to add a configuration entry. Must match the name returned by the CustomOp's GetName() method.
  config_key | The name of the configuration entry.
  config_value | The value of the configuration entry.

Returns
  A reference to this object to enable call chaining.

## GetFlattenedConfigs()

const std::unordered_map< std::string, std::string > & Ort::CustomOpConfigs::GetFlattenedConfigs | ( |  | ) | const

Returns a flattened map of custom operator configuration entries and their values.

The keys has been flattened to include both the custom operator name and the configuration entry key name. For example, a prior call to AddConfig("my_op", "key", "value") corresponds to the flattened key/value pair {"my_op.key", "value"}.

Returns
  An unordered map of flattened configurations.

## operator=() [1/2]

CustomOpConfigs & Ort::CustomOpConfigs::operator= | ( | const CustomOpConfigs & |  | ) |

default

## operator=() [2/2]

CustomOpConfigs & Ort::CustomOpConfigs::operator= | ( | CustomOpConfigs && | o | ) |

default