Skip to content

Commit

Permalink
Merge pull request #9 from FabianThomsen/main
Browse files Browse the repository at this point in the history
  • Loading branch information
lreiher authored Jun 22, 2023
2 parents 1cc8942 + 08858ea commit a3c3aaa
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.8)
project(tensorflow_cpp VERSION 1.0.5 LANGUAGES CXX)
project(tensorflow_cpp VERSION 1.0.6 LANGUAGES CXX)

find_package(ros_environment QUIET)
if(ros_environment_FOUND)
Expand Down
2 changes: 1 addition & 1 deletion doc/Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#---------------------------------------------------------------------------
# DOXYFILE_ENCODING = UTF-8
PROJECT_NAME = "tensorflow_cpp"
PROJECT_NUMBER = 1.0.5
PROJECT_NUMBER = 1.0.6
# PROJECT_BRIEF =
# PROJECT_LOGO =
# OUTPUT_DIRECTORY =
Expand Down
10 changes: 5 additions & 5 deletions include/tensorflow_cpp/model.h
Original file line number Diff line number Diff line change
Expand Up @@ -162,17 +162,17 @@ class Model {
*/
std::unordered_map<std::string, tf::Tensor> operator()(
const std::vector<std::pair<std::string, tf::Tensor>>& inputs,
const std::vector<std::string>& output_names) {
const std::vector<std::string>& output_names) const{

// properly set input/output names for session->Run()
std::vector<std::pair<std::string, tf::Tensor>> input_nodes;
std::vector<std::string> output_node_names;
if (is_saved_model_) {
for (const auto& input : inputs)
input_nodes.push_back(
{saved_model_layer2node_[input.first], input.second});
{saved_model_layer2node_.find(input.first)->second, input.second});
for (const auto& name : output_names)
output_node_names.push_back(saved_model_layer2node_[name]);
output_node_names.push_back(saved_model_layer2node_.find(name)->second);
} else if (is_frozen_graph_) {
input_nodes = inputs;
output_node_names = output_names;
Expand Down Expand Up @@ -207,7 +207,7 @@ class Model {
*
* @return tf::Tensor output tensor
*/
tf::Tensor operator()(const tf::Tensor& input_tensor) {
tf::Tensor operator()(const tf::Tensor& input_tensor) const {

if (n_inputs_ != 1 || n_outputs_ != 1) {
throw std::runtime_error(
Expand Down Expand Up @@ -235,7 +235,7 @@ class Model {
* @return std::vector<tf::Tensor> output tensors
*/
std::vector<tf::Tensor> operator()(
const std::vector<tf::Tensor>& input_tensors) {
const std::vector<tf::Tensor>& input_tensors) const {

if (input_tensors.size() != n_inputs_) {
throw std::runtime_error(
Expand Down
2 changes: 1 addition & 1 deletion package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package format="3">

<name>tensorflow_cpp</name>
<version>1.0.5</version>
<version>1.0.6</version>
<description>Wrappers around the TensorFlow C++ API for easy usage in ROS</description>

<maintainer email="[email protected]">Lennart Reiher</maintainer>
Expand Down

0 comments on commit a3c3aaa

Please sign in to comment.