Skip to content

Commit

Permalink
* Include checkpoint_reader.h for TensorFlow (issue #494)
Browse files Browse the repository at this point in the history
  • Loading branch information
saudet committed Jan 7, 2018
1 parent 039cab5 commit 5daeaf7
Show file tree
Hide file tree
Showing 4 changed files with 1,341 additions and 2 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Add initial set of CUDA bindings for OpenCV ([pull #416](https://github.com/bytedeco/javacpp-presets/pull/416))
* Add CUDA/OpenCL-enabled builds for OpenCV, Caffe, and TensorFlow via `-gpu` extension ([issue bytedeco/javacv#481](https://github.com/bytedeco/javacv/issues/481))
* Enable NVIDIA CUDA, CUVID, and NVENC acceleration for FFmpeg ([pull #492](https://github.com/bytedeco/javacpp-presets/pull/492))
* Include `message_lite.h`, `saver.pb.h`, `meta_graph.pb.h`, and `loader.h` for TensorFlow ([issue #494](https://github.com/bytedeco/javacpp-presets/issues/494))
* Include `message_lite.h`, `checkpoint_reader.h`, `saver.pb.h`, `meta_graph.pb.h`, and `loader.h` for TensorFlow ([issue #494](https://github.com/bytedeco/javacpp-presets/issues/494))
* Add `getString()` helper methods to `CXString`, `CXTUResourceUsageKind`, and `CXEvalResult` for `clang` ([issue bytedeco/javacpp#51](https://github.com/bytedeco/javacpp/issues/51))
* Add support for Mac OS X and Windows to presets for librealsense ([issue #447](https://github.com/bytedeco/javacpp-presets/issues/447))
* Enable MMAL and OpenMAX acceleration for FFmpeg on `linux-armhf` ([pull #388](https://github.com/bytedeco/javacpp-presets/pull/388))
Expand Down
3 changes: 3 additions & 0 deletions tensorflow/cppbuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ tar --totals -xzf ../tensorflow-$TENSORFLOW_VERSION.tar.gz
# Assumes Bazel is available in the path: http://bazel.io/docs/install.html
cd tensorflow-$TENSORFLOW_VERSION

# Allow using std::unordered_map<tensorflow::string,tensorflow::checkpoint::TensorSliceSet::SliceInfo>
sed -i="" "s/const string tag/string tag/g" tensorflow/core/util/tensor_slice_set.h

# https://github.com/tensorflow/tensorflow/issues/15389
sed -i="" "s/429aa5254200/034b6c3e1017/g" tensorflow/workspace.bzl
sed -i="" "s/61d8b6fc4279dd1dda986fb1677d15e3d641c07a3ea5abe255790b1f0c0c14e9/0a8ac1e83ef9c26c0e362bd7968650b710ce54e2d883f0df84e5e45a3abe842a/g" tensorflow/workspace.bzl
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,14 @@
"tensorflow/core/framework/partial_tensor_shape.h",
"tensorflow/core/framework/device_attributes.pb.h",
"tensorflow/core/public/session.h",
"tensorflow/core/framework/tensor_slice.pb.h",
"tensorflow/core/framework/tensor_slice.h",
"tensorflow/core/util/tensor_slice_set.h",
"tensorflow/core/util/tensor_slice_util.h",
"tensorflow/core/util/tensor_slice_reader.h",
"tensorflow/core/util/tensor_bundle/tensor_bundle.h",
"tensorflow/c/tf_status_helper.h",
"tensorflow/c/checkpoint_reader.h",
"tensorflow/c/c_api.h",
"tensorflow/core/framework/op_def.pb.h",
"tensorflow/core/framework/op_def_builder.h",
Expand Down Expand Up @@ -197,6 +205,14 @@
"tensorflow/core/framework/partial_tensor_shape.h",
"tensorflow/core/framework/device_attributes.pb.h",
"tensorflow/core/public/session.h",
"tensorflow/core/framework/tensor_slice.pb.h",
"tensorflow/core/framework/tensor_slice.h",
"tensorflow/core/util/tensor_slice_set.h",
"tensorflow/core/util/tensor_slice_util.h",
"tensorflow/core/util/tensor_slice_reader.h",
"tensorflow/core/util/tensor_bundle/tensor_bundle.h",
"tensorflow/c/tf_status_helper.h",
"tensorflow/c/checkpoint_reader.h",
"tensorflow/c/c_api.h",
"tensorflow/core/framework/op_def.pb.h",
"tensorflow/core/framework/op_def_builder.h",
Expand Down Expand Up @@ -302,7 +318,8 @@ public void map(InfoMap infoMap) {
"tensorflow::MetaGraphDef_CollectionDefEntryDefaultTypeInternal", "tensorflow::MetaGraphDef_CollectionDefEntryDefaultTypeInternal",
"tensorflow::MetaGraphDef_MetaInfoDefDefaultTypeInternal", "tensorflow::MetaGraphDef_SignatureDefEntryDefaultTypeInternal",
"tensorflow::MetaGraphDef_SignatureDefEntryDefaultTypeInternal", "tensorflow::SignatureDefDefaultTypeInternal", "tensorflow::SignatureDef_InputsEntryDefaultTypeInternal",
"tensorflow::SignatureDef_OutputsEntryDefaultTypeInternal", "tensorflow::TensorInfoDefaultTypeInternal", "tensorflow::TensorInfo_CooSparseDefaultTypeInternal").skip())
"tensorflow::SignatureDef_OutputsEntryDefaultTypeInternal", "tensorflow::TensorInfoDefaultTypeInternal", "tensorflow::TensorInfo_CooSparseDefaultTypeInternal",
"tensorflow::TensorSliceProtoDefaultTypeInternal", "tensorflow::TensorSliceProto_ExtentDefaultTypeInternal").skip())

.put(new Info("tensorflow::core::RefCounted").cast().pointerTypes("Pointer"))
.put(new Info("tensorflow::ConditionResult").cast().valueTypes("int"))
Expand Down Expand Up @@ -380,8 +397,14 @@ public void map(InfoMap infoMap) {
.put(new Info("tensorflow::register_op::OpDefBuilderWrapper<true>").pointerTypes("TrueOpDefBuilderWrapper"))
.put(new Info("tensorflow::register_op::OpDefBuilderWrapper<false>").pointerTypes("FalseOpDefBuilderWrapper"))

.put(new Info("tensorflow::checkpoint::TensorSliceSet::SliceInfo").pointerTypes("TensorSliceSet.SliceInfo"))
.put(new Info("std::pair<tensorflow::StringPiece,int>").pointerTypes("StringPieceIntPair").define())
.put(new Info("std::pair<tensorflow::TensorSlice,tensorflow::string>").pointerTypes("TensorSlideStringPair").define())
.put(new Info("std::map<tensorflow::TensorId,tensorflow::TensorId>").pointerTypes("TensorIdTensorIdMap").define())
.put(new Info("std::unordered_map<std::string,tensorflow::TensorShape>").pointerTypes("VarToShapeMap").define())
.put(new Info("std::unordered_map<std::string,tensorflow::DataType>").pointerTypes("VarToDataTypeMap").define())
.put(new Info("std::unordered_map<tensorflow::string,tensorflow::checkpoint::TensorSliceSet*>").pointerTypes("StringTensorSliceSetMap").define())
.put(new Info("std::unordered_map<tensorflow::string,tensorflow::checkpoint::TensorSliceSet::SliceInfo>").pointerTypes("StringSliceInfoMap").define())
.put(new Info("std::vector<tensorflow::Input>::iterator", "std::vector<tensorflow::Input>::const_iterator").skip())
.put(new Info("TF_WhileParams").purify())
.put(new Info("TF_LoadSessionFromSavedModel").annotations("@Platform(not=\"android\")").javaNames("TF_LoadSessionFromSavedModel"))
Expand Down
Loading

0 comments on commit 5daeaf7

Please sign in to comment.