9
9
use std:: ffi:: CStr ;
10
10
use std:: ffi:: CString ;
11
11
use std:: ffi:: NulError ;
12
+ use std:: os:: raw:: c_void as std_c_void;
12
13
use std:: ptr;
13
14
use std:: str:: Utf8Error ;
14
15
use std:: sync:: Arc ;
@@ -302,7 +303,7 @@ impl Operation {
302
303
pub fn output_type ( & self , index : usize ) -> DataType {
303
304
unsafe {
304
305
DataType :: from_c ( tf:: TF_OperationOutputType ( tf:: TF_Output {
305
- operation : self . inner ,
306
+ oper : self . inner ,
306
307
index : index as c_int ,
307
308
} ) )
308
309
}
@@ -332,7 +333,7 @@ impl Operation {
332
333
pub fn input_type ( & self , index : usize ) -> DataType {
333
334
unsafe {
334
335
DataType :: from_c ( tf:: TF_OperationInputType ( tf:: TF_Input {
335
- operation : self . inner ,
336
+ oper : self . inner ,
336
337
index : index as c_int ,
337
338
} ) )
338
339
}
@@ -359,11 +360,11 @@ impl Operation {
359
360
pub fn input ( & self , index : usize ) -> ( Operation , usize ) {
360
361
unsafe {
361
362
let port = tf:: TF_OperationInput ( tf:: TF_Input {
362
- operation : self . inner ,
363
+ oper : self . inner ,
363
364
index : index as c_int ,
364
365
} ) ;
365
366
( Operation {
366
- inner : port. operation ,
367
+ inner : port. oper ,
367
368
gimpl : self . gimpl . clone ( ) ,
368
369
} ,
369
370
port. index as usize )
@@ -374,7 +375,7 @@ impl Operation {
374
375
pub fn output_num_consumers ( & self , index : usize ) -> usize {
375
376
unsafe {
376
377
tf:: TF_OperationOutputNumConsumers ( tf:: TF_Output {
377
- operation : self . inner ,
378
+ oper : self . inner ,
378
379
index : index as c_int ,
379
380
} ) as usize
380
381
}
@@ -387,12 +388,12 @@ impl Operation {
387
388
pub fn output_consumers ( & self , index : usize ) -> Vec < ( Operation , usize ) > {
388
389
unsafe {
389
390
let num_consumers = tf:: TF_OperationOutputNumConsumers ( tf:: TF_Output {
390
- operation : self . inner ,
391
+ oper : self . inner ,
391
392
index : index as c_int ,
392
393
} ) ;
393
394
let mut vec = <Vec < tf:: TF_Input > >:: with_capacity ( num_consumers as usize ) ;
394
395
let len = tf:: TF_OperationOutputConsumers ( tf:: TF_Output {
395
- operation : self . inner ,
396
+ oper : self . inner ,
396
397
index : index as c_int ,
397
398
} ,
398
399
vec. as_mut_ptr ( ) ,
@@ -401,7 +402,7 @@ impl Operation {
401
402
vec. into_iter ( )
402
403
. map ( |port| {
403
404
( Operation {
404
- inner : port. operation ,
405
+ inner : port. oper ,
405
406
gimpl : self . gimpl . clone ( ) ,
406
407
} ,
407
408
port. index as usize )
@@ -483,7 +484,7 @@ pub struct Input<'a> {
483
484
impl < ' a > Input < ' a > {
484
485
fn to_c ( & self ) -> tf:: TF_Input {
485
486
tf:: TF_Input {
486
- operation : self . operation . inner ,
487
+ oper : self . operation . inner ,
487
488
index : self . index ,
488
489
}
489
490
}
@@ -505,7 +506,7 @@ pub struct Output<'a> {
505
506
impl < ' a > Output < ' a > {
506
507
fn to_c ( & self ) -> tf:: TF_Output {
507
508
tf:: TF_Output {
508
- operation : self . operation . inner ,
509
+ oper : self . operation . inner ,
509
510
index : self . index ,
510
511
}
511
512
}
@@ -606,7 +607,7 @@ impl<'a> OperationDescription<'a> {
606
607
unsafe {
607
608
tf:: TF_SetAttrString ( self . inner ,
608
609
c_attr_name. as_ptr ( ) ,
609
- c_value. as_ptr ( ) as * const c_void ,
610
+ c_value. as_ptr ( ) as * const std_c_void ,
610
611
c_value. len ( ) as size_t ) ;
611
612
}
612
613
Ok ( ( ) )
@@ -625,7 +626,7 @@ impl<'a> OperationDescription<'a> {
625
626
unsafe {
626
627
tf:: TF_SetAttrStringList ( self . inner ,
627
628
c_attr_name. as_ptr ( ) ,
628
- ptrs. as_ptr ( ) ,
629
+ ptrs. as_ptr ( ) as * const * const std_c_void ,
629
630
lens. as_ptr ( ) ,
630
631
ptrs. len ( ) as c_int ) ;
631
632
}
@@ -821,7 +822,7 @@ impl<'a> OperationDescription<'a> {
821
822
unsafe {
822
823
tf:: TF_SetAttrTensorShapeProto ( self . inner ,
823
824
c_attr_name. as_ptr ( ) ,
824
- value. as_ptr ( ) as * const c_void ,
825
+ value. as_ptr ( ) as * const std_c_void ,
825
826
value. len ( ) as size_t ,
826
827
status. inner ( ) ) ;
827
828
}
@@ -843,7 +844,7 @@ impl<'a> OperationDescription<'a> {
843
844
unsafe {
844
845
tf:: TF_SetAttrTensorShapeProtoList ( self . inner ,
845
846
c_attr_name. as_ptr ( ) ,
846
- ptrs. as_ptr ( ) ,
847
+ ptrs. as_ptr ( ) as * const * const std_c_void ,
847
848
lens. as_ptr ( ) ,
848
849
ptrs. len ( ) as c_int ,
849
850
status. inner ( ) ) ;
@@ -878,7 +879,7 @@ impl<'a> OperationDescription<'a> {
878
879
let ptrs: Vec < * mut tf:: TF_Tensor > = value. into_iter ( ) . map ( |x| x. into_ptr ( ) ) . collect ( ) ;
879
880
tf:: TF_SetAttrTensorList ( self . inner ,
880
881
c_attr_name. as_ptr ( ) ,
881
- ptrs. as_ptr ( ) ,
882
+ ptrs. as_ptr ( ) as * const * const tf :: TF_Tensor ,
882
883
ptrs. len ( ) as c_int ,
883
884
status. inner ( ) ) ;
884
885
}
@@ -893,7 +894,7 @@ impl<'a> OperationDescription<'a> {
893
894
unsafe {
894
895
tf:: TF_SetAttrValueProto ( self . inner ,
895
896
c_attr_name. as_ptr ( ) ,
896
- value. as_ptr ( ) as * const c_void ,
897
+ value. as_ptr ( ) as * const std_c_void ,
897
898
// Allow trivial_numeric_casts because usize is not
898
899
// necessarily size_t.
899
900
value. len ( ) as size_t ,
0 commit comments