Skip to content

Commit

Permalink
fix: Build break in onnx_extension
Browse files Browse the repository at this point in the history
Also deprecate onnx.use_unstructured_input in favour of the INPUT_SERIALIZATION configuration parameter.
  • Loading branch information
lokitoth committed Feb 19, 2024
1 parent 3c2760b commit d8d8bf5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
7 changes: 5 additions & 2 deletions rlclientlib/extensions/onnx/include/onnx_extension.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#pragma once

#include "future_compat.h"

namespace reinforcement_learning
{
namespace onnx
Expand All @@ -17,9 +19,8 @@ namespace name
// TODO: Explore and expose useful configuration settings here
const char* const ONNX_OUTPUT_NAME = "onnx.output_name";

const char* const TENSOR_NOTATION_INPUT_SERIALIZATION = "ONNX/TENSOR_NOTATION";

// Unstructured input === TENSOR_NOTATION_INPUT_SERIALIZATION
RL_DEPRECATED("Use the INPUT_SERIALIZATION configuration mechanism with the TENSOR_NOTATION value instead")
const char* const ONNX_USE_UNSTRUCTURED_INPUT = "onnx.use_unstructured_input";

} // namespace name
Expand All @@ -30,5 +31,7 @@ namespace reinforcement_learning
namespace value
{
const char* const ONNXRUNTIME_MODEL = "ONNXRUNTIME";

const char* const TENSOR_NOTATION_INPUT_SERIALIZATION = "ONNX/TENSOR_NOTATION";
}
} // namespace reinforcement_learning
4 changes: 4 additions & 0 deletions rlclientlib/extensions/onnx/src/onnx_extension.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include "constants.h"
#include "err_constants.h"
#include "factory_resolver.h"
#include "future_compat.h"
#include "model_mgmt.h"
#include "onnx_model.h"

Expand All @@ -26,7 +27,10 @@ int create_onnx_model(
<< "Output name is not provided in the configuration.";
}

RL_IGNORE_DEPRECATED_USAGE_START()

Check failure on line 30 in rlclientlib/extensions/onnx/src/onnx_extension.cc

View workflow job for this annotation

GitHub Actions / rlclientlib-debug-ubuntu-latest

expected primary-expression before ‘)’ token

Check failure on line 30 in rlclientlib/extensions/onnx/src/onnx_extension.cc

View workflow job for this annotation

GitHub Actions / rlclientlib-release-ubuntu-latest

expected primary-expression before ‘)’ token
bool use_unstructured_input = config.get_bool(name::ONNX_USE_UNSTRUCTURED_INPUT, false);
RL_IGNORE_DEPRECATED_USAGE_END()

Check failure on line 32 in rlclientlib/extensions/onnx/src/onnx_extension.cc

View workflow job for this annotation

GitHub Actions / rlclientlib-debug-ubuntu-latest

expected primary-expression before ‘)’ token

Check failure on line 32 in rlclientlib/extensions/onnx/src/onnx_extension.cc

View workflow job for this annotation

GitHub Actions / rlclientlib-release-ubuntu-latest

expected primary-expression before ‘)’ token

const char* input_serialization = config.get(name::INPUT_SERIALIZATION, value::TENSOR_NOTATION_INPUT_SERIALIZATION);

// TODO: deprecate "USE_UNSUTRUCTURED_INPUT" in favour of "INPUT_SERIALIZATION" types
Expand Down

0 comments on commit d8d8bf5

Please sign in to comment.