Skip to content

Commit 15a40b0

Browse files
authored
Merge pull request #96 from adamcrume/master
Upgrade to TensorFlow 1.2.1
2 parents 8a42a6e + 3b85965 commit 15a40b0

File tree

4 files changed

+25
-99
lines changed

4 files changed

+25
-99
lines changed

src/graph.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,9 @@ impl ImportGraphDefOptions {
9595
-> std::result::Result<(), NulError> {
9696
let s = CString::new(src_name)?;
9797
unsafe {
98-
tf::TF_GraphImportGraphDefOptionsRemapControlDependency(self.inner,
99-
s.as_ptr(),
100-
dst.inner);
98+
tf::TF_ImportGraphDefOptionsRemapControlDependency(self.inner,
99+
s.as_ptr(),
100+
dst.inner);
101101
}
102102
Ok(())
103103
}

tensorflow-sys/build.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ const LIBRARY: &'static str = "tensorflow";
2222
const REPOSITORY: &'static str = "https://github.com/tensorflow/tensorflow.git";
2323
const TARGET: &'static str = "tensorflow:libtensorflow.so";
2424
// `VERSION` and `TAG` are separate because the tag is not always `'v' + VERSION`.
25-
const VERSION: &'static str = "1.1.0";
26-
const TAG: &'static str = "v1.1.0";
25+
const VERSION: &'static str = "1.2.1";
26+
const TAG: &'static str = "v1.2.1";
2727
const MIN_BAZEL: &'static str = "0.3.2";
2828

2929
macro_rules! get(($name:expr) => (ok!(env::var($name))));

tensorflow-sys/generate_bindgen_rs.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/sh
22

3-
if ! which bindgen &> /dev/null; then
3+
if ! which bindgen > /dev/null; then
44
echo "ERROR: Please install 'bindgen' using cargo:"
55
echo " cargo install bindgen"
66
echo "See https://github.com/servo/rust-bindgen for more information."

tensorflow-sys/src/bindgen.rs

Lines changed: 19 additions & 93 deletions
Original file line numberDiff line numberDiff line change
@@ -22,25 +22,15 @@ pub const __USE_FORTIFY_LEVEL: ::std::os::raw::c_uint = 0;
2222
pub const _STDC_PREDEF_H: ::std::os::raw::c_uint = 1;
2323
pub const __STDC_IEC_559__: ::std::os::raw::c_uint = 1;
2424
pub const __STDC_IEC_559_COMPLEX__: ::std::os::raw::c_uint = 1;
25-
pub const __STDC_ISO_10646__: ::std::os::raw::c_uint = 201505;
25+
pub const __STDC_ISO_10646__: ::std::os::raw::c_uint = 201605;
2626
pub const __STDC_NO_THREADS__: ::std::os::raw::c_uint = 1;
2727
pub const __GNU_LIBRARY__: ::std::os::raw::c_uint = 6;
2828
pub const __GLIBC__: ::std::os::raw::c_uint = 2;
29-
pub const __GLIBC_MINOR__: ::std::os::raw::c_uint = 25;
29+
pub const __GLIBC_MINOR__: ::std::os::raw::c_uint = 24;
3030
pub const _SYS_CDEFS_H: ::std::os::raw::c_uint = 1;
31-
pub const __glibc_c99_flexarr_available: ::std::os::raw::c_uint = 1;
3231
pub const __WORDSIZE: ::std::os::raw::c_uint = 64;
3332
pub const __WORDSIZE_TIME64_COMPAT32: ::std::os::raw::c_uint = 1;
3433
pub const __SYSCALL_WORDSIZE: ::std::os::raw::c_uint = 64;
35-
pub const __GLIBC_USE_LIB_EXT2: ::std::os::raw::c_uint = 0;
36-
pub const __GLIBC_USE_IEC_60559_BFP_EXT: ::std::os::raw::c_uint = 0;
37-
pub const __GLIBC_USE_IEC_60559_FUNCS_EXT: ::std::os::raw::c_uint = 0;
38-
pub const _BITS_TYPES_H: ::std::os::raw::c_uint = 1;
39-
pub const _BITS_TYPESIZES_H: ::std::os::raw::c_uint = 1;
40-
pub const __OFF_T_MATCHES_OFF64_T: ::std::os::raw::c_uint = 1;
41-
pub const __INO_T_MATCHES_INO64_T: ::std::os::raw::c_uint = 1;
42-
pub const __RLIM_T_MATCHES_RLIM64_T: ::std::os::raw::c_uint = 1;
43-
pub const __FD_SETSIZE: ::std::os::raw::c_uint = 1024;
4434
pub const _BITS_WCHAR_H: ::std::os::raw::c_uint = 1;
4535
pub const INT8_MIN: ::std::os::raw::c_int = -128;
4636
pub const INT16_MIN: ::std::os::raw::c_int = -32768;
@@ -80,79 +70,6 @@ pub const SIZE_MAX: ::std::os::raw::c_int = -1;
8070
pub const WINT_MIN: ::std::os::raw::c_uint = 0;
8171
pub const WINT_MAX: ::std::os::raw::c_uint = 4294967295;
8272
pub type wchar_t = ::std::os::raw::c_int;
83-
pub type __u_char = ::std::os::raw::c_uchar;
84-
pub type __u_short = ::std::os::raw::c_ushort;
85-
pub type __u_int = ::std::os::raw::c_uint;
86-
pub type __u_long = ::std::os::raw::c_ulong;
87-
pub type __int8_t = ::std::os::raw::c_schar;
88-
pub type __uint8_t = ::std::os::raw::c_uchar;
89-
pub type __int16_t = ::std::os::raw::c_short;
90-
pub type __uint16_t = ::std::os::raw::c_ushort;
91-
pub type __int32_t = ::std::os::raw::c_int;
92-
pub type __uint32_t = ::std::os::raw::c_uint;
93-
pub type __int64_t = ::std::os::raw::c_long;
94-
pub type __uint64_t = ::std::os::raw::c_ulong;
95-
pub type __quad_t = ::std::os::raw::c_long;
96-
pub type __u_quad_t = ::std::os::raw::c_ulong;
97-
pub type __intmax_t = ::std::os::raw::c_long;
98-
pub type __uintmax_t = ::std::os::raw::c_ulong;
99-
pub type __dev_t = ::std::os::raw::c_ulong;
100-
pub type __uid_t = ::std::os::raw::c_uint;
101-
pub type __gid_t = ::std::os::raw::c_uint;
102-
pub type __ino_t = ::std::os::raw::c_ulong;
103-
pub type __ino64_t = ::std::os::raw::c_ulong;
104-
pub type __mode_t = ::std::os::raw::c_uint;
105-
pub type __nlink_t = ::std::os::raw::c_ulong;
106-
pub type __off_t = ::std::os::raw::c_long;
107-
pub type __off64_t = ::std::os::raw::c_long;
108-
pub type __pid_t = ::std::os::raw::c_int;
109-
#[repr(C)]
110-
#[derive(Debug, Copy)]
111-
pub struct __fsid_t {
112-
pub __val: [::std::os::raw::c_int; 2usize],
113-
}
114-
#[test]
115-
fn bindgen_test_layout___fsid_t() {
116-
assert_eq!(::std::mem::size_of::<__fsid_t>() , 8usize , concat ! (
117-
"Size of: " , stringify ! ( __fsid_t ) ));
118-
assert_eq! (::std::mem::align_of::<__fsid_t>() , 4usize , concat ! (
119-
"Alignment of " , stringify ! ( __fsid_t ) ));
120-
assert_eq! (unsafe {
121-
& ( * ( 0 as * const __fsid_t ) ) . __val as * const _ as
122-
usize } , 0usize , concat ! (
123-
"Alignment of field: " , stringify ! ( __fsid_t ) , "::" ,
124-
stringify ! ( __val ) ));
125-
}
126-
impl Clone for __fsid_t {
127-
fn clone(&self) -> Self { *self }
128-
}
129-
pub type __clock_t = ::std::os::raw::c_long;
130-
pub type __rlim_t = ::std::os::raw::c_ulong;
131-
pub type __rlim64_t = ::std::os::raw::c_ulong;
132-
pub type __id_t = ::std::os::raw::c_uint;
133-
pub type __time_t = ::std::os::raw::c_long;
134-
pub type __useconds_t = ::std::os::raw::c_uint;
135-
pub type __suseconds_t = ::std::os::raw::c_long;
136-
pub type __daddr_t = ::std::os::raw::c_int;
137-
pub type __key_t = ::std::os::raw::c_int;
138-
pub type __clockid_t = ::std::os::raw::c_int;
139-
pub type __timer_t = *mut ::std::os::raw::c_void;
140-
pub type __blksize_t = ::std::os::raw::c_long;
141-
pub type __blkcnt_t = ::std::os::raw::c_long;
142-
pub type __blkcnt64_t = ::std::os::raw::c_long;
143-
pub type __fsblkcnt_t = ::std::os::raw::c_ulong;
144-
pub type __fsblkcnt64_t = ::std::os::raw::c_ulong;
145-
pub type __fsfilcnt_t = ::std::os::raw::c_ulong;
146-
pub type __fsfilcnt64_t = ::std::os::raw::c_ulong;
147-
pub type __fsword_t = ::std::os::raw::c_long;
148-
pub type __ssize_t = ::std::os::raw::c_long;
149-
pub type __syscall_slong_t = ::std::os::raw::c_long;
150-
pub type __syscall_ulong_t = ::std::os::raw::c_ulong;
151-
pub type __loff_t = __off64_t;
152-
pub type __qaddr_t = *mut __quad_t;
153-
pub type __caddr_t = *mut ::std::os::raw::c_char;
154-
pub type __intptr_t = ::std::os::raw::c_long;
155-
pub type __socklen_t = ::std::os::raw::c_uint;
15673
pub type int_least8_t = ::std::os::raw::c_schar;
15774
pub type int_least16_t = ::std::os::raw::c_short;
15875
pub type int_least32_t = ::std::os::raw::c_int;
@@ -169,8 +86,8 @@ pub type uint_fast8_t = ::std::os::raw::c_uchar;
16986
pub type uint_fast16_t = ::std::os::raw::c_ulong;
17087
pub type uint_fast32_t = ::std::os::raw::c_ulong;
17188
pub type uint_fast64_t = ::std::os::raw::c_ulong;
172-
pub type intmax_t = __intmax_t;
173-
pub type uintmax_t = __uintmax_t;
89+
pub type intmax_t = ::std::os::raw::c_long;
90+
pub type uintmax_t = ::std::os::raw::c_ulong;
17491
extern "C" {
17592
pub fn TF_Version() -> *const ::std::os::raw::c_char;
17693
}
@@ -316,6 +233,9 @@ extern "C" {
316233
num_dims: ::std::os::raw::c_int, len: usize)
317234
-> *mut TF_Tensor;
318235
}
236+
extern "C" {
237+
pub fn TF_TensorMaybeMove(tensor: *mut TF_Tensor) -> *mut TF_Tensor;
238+
}
319239
extern "C" {
320240
pub fn TF_DeleteTensor(arg1: *mut TF_Tensor);
321241
}
@@ -901,12 +821,12 @@ extern "C" {
901821
dst: TF_Output);
902822
}
903823
extern "C" {
904-
pub fn TF_GraphImportGraphDefOptionsRemapControlDependency(opts:
905-
*mut TF_ImportGraphDefOptions,
906-
src_name:
907-
*const ::std::os::raw::c_char,
908-
dst:
909-
*mut TF_Operation);
824+
pub fn TF_ImportGraphDefOptionsRemapControlDependency(opts:
825+
*mut TF_ImportGraphDefOptions,
826+
src_name:
827+
*const ::std::os::raw::c_char,
828+
dst:
829+
*mut TF_Operation);
910830
}
911831
extern "C" {
912832
pub fn TF_ImportGraphDefOptionsAddControlDependency(opts:
@@ -1024,6 +944,12 @@ extern "C" {
1024944
extern "C" {
1025945
pub fn TF_AbortWhile(params: *const TF_WhileParams);
1026946
}
947+
extern "C" {
948+
pub fn TF_AddGradients(g: *mut TF_Graph, y: *mut TF_Output,
949+
ny: ::std::os::raw::c_int, x: *mut TF_Output,
950+
nx: ::std::os::raw::c_int, dx: *mut TF_Output,
951+
status: *mut TF_Status, dy: *mut TF_Output);
952+
}
1027953
#[repr(C)]
1028954
#[derive(Debug, Copy, Clone)]
1029955
pub struct TF_Session {

0 commit comments

Comments
 (0)