11//! This crate provides Rust bindings for the
2- //! [TensorFlow](https://www.tensorflow.org) machine learning library.
2+ //! [` TensorFlow` ](https://www.tensorflow.org) machine learning library.
33
44#![ warn( missing_copy_implementations,
55 missing_debug_implementations,
@@ -343,6 +343,7 @@ c_enum!("Type of a single tensor element.", TF_DataType, DataType {
343343 /// 16-bit floating point.
344344 value Half = 19 ,
345345
346+ /// TensorFlow Resource (name, container, device,...)
346347 value Resource = 20 ,
347348} ) ;
348349
@@ -936,7 +937,7 @@ impl<T: TensorType> Deref for Tensor<T> {
936937
937938impl < T : TensorType > DerefMut for Tensor < T > {
938939 #[ inline]
939- fn deref_mut < ' a > ( & ' a mut self ) -> & ' a mut [ T ] {
940+ fn deref_mut ( & mut self ) -> & mut [ T ] {
940941 & mut self . data
941942 }
942943}
@@ -1010,7 +1011,7 @@ trait OperationTrait {
10101011////////////////////////
10111012
10121013/// Returns a string describing version information of the
1013- /// TensorFlow library. TensorFlow using semantic versioning.
1014+ /// ` TensorFlow` library. ` TensorFlow` is using semantic versioning.
10141015pub fn version ( ) -> std:: result:: Result < String , Utf8Error > {
10151016 unsafe { CStr :: from_ptr ( tf:: TF_Version ( ) ) . to_str ( ) . map ( |s| s. to_string ( ) ) }
10161017}
@@ -1028,9 +1029,9 @@ pub struct Shape(Option<Vec<Option<i64>>>);
10281029impl Shape {
10291030 /// Returns the number of dimensions if known, or None if unknown.
10301031 pub fn dims ( & self ) -> Option < usize > {
1031- match self {
1032- & Shape ( None ) => None ,
1033- & Shape ( Some ( ref v) ) => Some ( v. len ( ) ) ,
1032+ match * self {
1033+ Shape ( None ) => None ,
1034+ Shape ( Some ( ref v) ) => Some ( v. len ( ) ) ,
10341035 }
10351036 }
10361037}
@@ -1053,9 +1054,9 @@ impl Index<usize> for Shape {
10531054 type Output = Option < i64 > ;
10541055
10551056 fn index ( & self , index : usize ) -> & Option < i64 > {
1056- match & self . 0 {
1057- & None => & UNKNOWN_DIMENSION ,
1058- & Some ( ref v) => {
1057+ match self . 0 {
1058+ None => & UNKNOWN_DIMENSION ,
1059+ Some ( ref v) => {
10591060 if index < v. len ( ) {
10601061 & v[ index]
10611062 } else {
0 commit comments