@@ -14,7 +14,7 @@ extern crate libc;
14
14
extern crate num_complex;
15
15
extern crate tensorflow_sys as tf;
16
16
17
- use libc:: { c_int, c_uint, size_t } ;
17
+ use libc:: { c_int, c_uint} ;
18
18
use num_complex:: Complex ;
19
19
use std:: cmp:: Ordering ;
20
20
use std:: error:: Error ;
@@ -30,7 +30,6 @@ use std::ops::Deref;
30
30
use std:: ops:: DerefMut ;
31
31
use std:: ops:: Drop ;
32
32
use std:: ops:: Index ;
33
- use std:: os:: raw:: c_void as std_c_void;
34
33
use std:: str:: Utf8Error ;
35
34
36
35
////////////////////////
@@ -661,12 +660,6 @@ pub struct Tensor<T: TensorType> {
661
660
owned : bool ,
662
661
}
663
662
664
- unsafe extern "C" fn noop_deallocator ( _: * mut std_c_void , _: size_t , _: * mut std_c_void ) -> ( ) { }
665
-
666
- unsafe extern "C" fn deallocator ( _: * mut std_c_void , _: size_t , buffer : * mut std_c_void ) -> ( ) {
667
- tf:: TF_DeleteBuffer ( buffer as * mut tf:: TF_Buffer ) ;
668
- }
669
-
670
663
#[ inline]
671
664
fn product ( values : & [ u64 ] ) -> u64 {
672
665
values. iter ( ) . product ( )
@@ -692,18 +685,6 @@ impl<T: TensorType> Tensor<T> {
692
685
}
693
686
}
694
687
695
- /// Returns the tensor's data.
696
- #[ deprecated( note="Deref the tensor as a slice instead." ) ]
697
- pub fn data ( & self ) -> & Buffer < T > {
698
- & self . data
699
- }
700
-
701
- /// Returns the tensor's data.
702
- #[ deprecated( note="Deref the tensor as a slice instead." ) ]
703
- pub fn data_mut ( & mut self ) -> & mut Buffer < T > {
704
- & mut self . data
705
- }
706
-
707
688
/// Returns the tensor's dimensions.
708
689
pub fn dims ( & self ) -> & [ u64 ] {
709
690
& self . dims
@@ -726,13 +707,6 @@ impl<T: TensorType> Tensor<T> {
726
707
owned : true ,
727
708
} )
728
709
}
729
-
730
- /// The caller is responsible for deleting the tensor.
731
- unsafe fn into_ptr ( mut self ) -> * mut tf:: TF_Tensor {
732
- // This flag is used by drop.
733
- self . owned = false ;
734
- self . inner
735
- }
736
710
}
737
711
738
712
impl < T : TensorType > Drop for Tensor < T > {
@@ -837,9 +811,6 @@ pub fn version() -> std::result::Result<String, Utf8Error> {
837
811
838
812
////////////////////////
839
813
840
- #[ deprecated( note="Use Shape instead." ) ]
841
- pub type TensorShape = Shape ;
842
-
843
814
/// A Shape is the shape of a tensor. A Shape may be an unknown rank, or it may
844
815
/// have a known rank with each dimension being known or unknown.
845
816
#[ derive( Debug , Eq , Ord , PartialEq , PartialOrd , Hash , Clone ) ]
0 commit comments