@@ -84,24 +84,6 @@ impl Session {
84
84
85
85
/// Runs the graph, feeding the inputs and then fetching the outputs requested in the step.
86
86
pub fn run ( & mut self , step : & mut StepWithGraph ) -> Result < ( ) > {
87
- // Copy the input tensors because TF_Run consumes them.
88
- let mut input_tensors = Vec :: with_capacity ( step. input_tensors . len ( ) ) ;
89
- for & input_tensor in & step. input_tensors {
90
- unsafe {
91
- let mut dims = Vec :: with_capacity ( tf:: TF_NumDims ( input_tensor) as usize ) ;
92
- for i in 0 ..dims. capacity ( ) {
93
- dims. push ( tf:: TF_Dim ( input_tensor, i as c_int ) ) ;
94
- }
95
- input_tensors. push ( tf:: TF_NewTensor ( tf:: TF_TensorType ( input_tensor) ,
96
- dims. as_ptr ( ) ,
97
- dims. len ( ) as c_int ,
98
- tf:: TF_TensorData ( input_tensor) ,
99
- tf:: TF_TensorByteSize ( input_tensor) ,
100
- Some ( super :: noop_deallocator) ,
101
- ptr:: null_mut ( ) ) ) ;
102
- }
103
- }
104
-
105
87
// In case we're running it a second time and not all outputs were taken out.
106
88
step. drop_output_tensors ( ) ;
107
89
@@ -110,8 +92,8 @@ impl Session {
110
92
tf:: TF_SessionRun ( self . inner ,
111
93
ptr:: null ( ) ,
112
94
step. input_ports . as_ptr ( ) ,
113
- input_tensors. as_ptr ( ) as * const * const tf:: TF_Tensor ,
114
- input_tensors. len ( ) as c_int ,
95
+ step . input_tensors . as_ptr ( ) as * const * const tf:: TF_Tensor ,
96
+ step . input_tensors . len ( ) as c_int ,
115
97
step. output_ports . as_ptr ( ) ,
116
98
step. output_tensors . as_mut_ptr ( ) ,
117
99
step. output_tensors . len ( ) as c_int ,
0 commit comments