Skip to content

Commit cf5ab4f

Browse files
committed
Adding requested changes
- RELEASING.md now has info about the new tensorflow-sys-runtime crate. - Additional info in the tensorflow-sys-runtime README.md showing how to use it. - Adding the version to tensorflow-sys-runtime in the main Cargo.toml - Removing runtime linking bindgen calls from tensorflow-sys/generate_bindgen_rs.sh
1 parent 7613d97 commit cf5ab4f

File tree

4 files changed

+13
-14
lines changed

4 files changed

+13
-14
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ libc = "0.2.132"
2424
num-complex = { version = "0.4.2", default-features = false }
2525
tensorflow-internal-macros = { version = "=0.0.3", path = "tensorflow-internal-macros" }
2626
tensorflow-sys = { version = "0.22.1", path = "tensorflow-sys", optional = true }
27-
tensorflow-sys-runtime = { path = "tensorflow-sys-runtime", optional = true }
27+
tensorflow-sys-runtime = { version = "0.1.0", path = "tensorflow-sys-runtime", optional = true }
2828
byteorder = "1.4.3"
2929
crc = "3.0.0"
3030
half = "2.1.0"

RELEASING.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@ Note that any crate not mentioned here (e.g. tensorflow-proto-codegen, tensorflo
2525
1. Bump the version in `tensorflow-sys/Cargo.toml`
2626
1. Bump the version in `tensorflow-sys/README.md`
2727
1. Bump the version for `tensorflow-sys` in the root `Cargo.toml`
28+
1. Bump version number of `tensorflow-sys-runtime` if necessary
29+
1. Run `git log v${PREVIOUS_VERSION?}..HEAD tensorflow-sys-runtime` and see if there were any changes. If not, skip.
30+
1. Bump the version in `tensorflow-sys-runtime/Cargo.toml`
31+
1. Bump the version in `tensorflow-sys-runtime/README.md`
32+
1. Bump the version for `tensorflow-sys-runtime` in the root `Cargo.toml`
2833
1. Bump version number of `tensorflow-internal-macros` if necessary
2934
1. Run `git log v${PREVIOUS_VERSION?}..HEAD tensorflow-internal-macros` and see if there were any changes. If not, skip.
3035
1. Bump the version in `tensorflow-internal-macros/Cargo.toml`
@@ -36,6 +41,7 @@ Note that any crate not mentioned here (e.g. tensorflow-proto-codegen, tensorflo
3641
1. Run `./run-valgrind`
3742
1. Commit and push the changes. (Push before publishing to ensure that the changes being published are up to date.)
3843
1. If the version of tensorflow-sys was bumped, run `cargo publish` for tensorflow-sys. (Publish before tagging in case there are problems publishing and we need to add commits to fix them.)
44+
1. If the version of tensorflow-sys-runtime was bumped, run `cargo publish` for tensorflow-sys-runtime. (Publish before tagging in case there are problems publishing and we need to add commits to fix them.)
3945
1. If the version of tensorflow-internal-macros was bumped, run `cargo publish` for tensorflow-internal-macros. (Publish before tagging in case there are problems publishing and we need to add commits to fix them.)
4046
1. Run `cargo publish`. (Publish before tagging in case there are problems publishing and we need to add commits to fix them.)
4147
1. Add a `v${VERSION?}` tag and push it

tensorflow-sys-runtime/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ before any other calls so that the linking is completed before use.
66

77
## NOTE
88
This crate is meant to be used by [Rust language bindings for Tensorflow][crates-tf]. It is not meant to be used on it's own.
9+
To use it you will need to disable the default features so you don't also include the tensorflow-sys crate.
10+
11+
```
12+
[dependencies]
13+
tensorflow = { version = "0.19.1", default-features = false, features = ["tensorflow_runtime_linking"]}
14+
```
915

1016
## Requirements
1117

tensorflow-sys/generate_bindgen_rs.sh

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,3 @@ bindgen_options_eager="--allowlist-function TFE_.+ --allowlist-type TFE_.+ --all
1818
cmd="bindgen ${bindgen_options_eager} ${include_dir}/tensorflow/c/eager/c_api.h --output src/eager/c_api.rs -- -I ${include_dir}"
1919
echo ${cmd}
2020
${cmd}
21-
22-
bindgen_options_runtime_functions="--allowlist-function TF_.+ --blocklist-type .+ --size_t-is-usize --default-enum-style=rust --generate-inline-functions"
23-
cmd="bindgen ${bindgen_options_runtime_functions} ${include_dir}/tensorflow/c/c_api.h --output src/runtime_linking/c_api.rs -- -I ${include_dir}"
24-
echo ${cmd}
25-
${cmd}
26-
27-
bindgen_options_runtime_types="--allowlist-type TF_.+ --blocklist-function .+ --size_t-is-usize --default-enum-style=rust --generate-inline-functions"
28-
cmd="bindgen ${bindgen_options_runtime_types} ${include_dir}/tensorflow/c/c_api.h --output src/runtime_linking/types.rs -- -I ${include_dir}"
29-
echo ${cmd}
30-
${cmd}
31-
32-
echo "link! {\n$(cat src/runtime_linking/c_api.rs)" > src/runtime_linking/c_api.rs
33-
echo } >> src/runtime_linking/c_api.rs

0 commit comments

Comments
 (0)