@@ -186,7 +186,7 @@ public static Tensor zeros(Tensor shape, TF_DataType dtype = TF_DataType.TF_FLOA
186186
187187 private static Tensor _constant_if_small ( int value , Tensor shape )
188188 {
189- return shape < 1000L ;
189+ return shape < 1000UL ;
190190 }
191191
192192 private static Tensor _constant_if_small < T > ( T value , TensorShape shape , TF_DataType dtype , string name )
@@ -330,7 +330,7 @@ public static Tensor rank(Tensor[] inputs, string name = null)
330330 {
331331 name = scope ;
332332 var input_tensor = ops . convert_to_tensor ( inputs ) ;
333- return constant_op . constant ( input_tensor . NDims , dtype : tf . int32 , name : name ) ;
333+ return constant_op . constant ( input_tensor . ndim , dtype : tf . int32 , name : name ) ;
334334 } ) ;
335335 }
336336
@@ -340,7 +340,7 @@ public static Tensor rank_internal(Tensor input, string name = null, bool optimi
340340 {
341341 name = scope ;
342342 var input_tensor = ops . convert_to_tensor ( input ) ;
343- var input_shape = tensor_util . to_shape ( input_tensor . shape ) ;
343+ var input_shape = input_tensor . shape ;
344344 if ( optimize && input_shape . ndim > 0 )
345345 return constant_op . constant ( input_shape . ndim , dtype : tf . int32 , name : name ) ;
346346 else
@@ -364,7 +364,7 @@ public static Tensor ones_like(Tensor tensor, TF_DataType dtype = TF_DataType.Dt
364364 tensor = ops . convert_to_tensor ( tensor , name : "tensor" ) ;
365365
366366 // is_fully_defined return unexpected value.
367- if ( optimize && tensor_util . to_shape ( tensor . shape ) . is_fully_defined ( ) && dtype != TF_DataType . TF_VARIANT )
367+ if ( optimize && tensor . shape . is_fully_defined ( ) && dtype != TF_DataType . TF_VARIANT )
368368 {
369369
370370 }
@@ -589,9 +589,9 @@ public static Tensor shape_internal(Tensor input, string name = null, bool optim
589589 if ( ! tf . Context . executing_eagerly ( ) )
590590 {
591591 var input_shape = input . TensorShape ;
592- if ( optimize && input . NDims > - 1 && input_shape . is_fully_defined ( ) )
592+ if ( optimize && input . ndim > - 1 && input_shape . is_fully_defined ( ) )
593593 {
594- var nd = np . array ( input . shape ) . astype ( out_type . as_system_dtype ( ) ) ;
594+ var nd = np . array ( input . shape . dims ) . astype ( out_type . as_system_dtype ( ) ) ;
595595 return constant_op . constant ( nd , name : name ) ;
596596 }
597597 }
@@ -607,7 +607,7 @@ private static Tensor size_internal<T>(T input, string name = null, bool optimiz
607607 name = scope ;
608608
609609 var input_tensor = ops . convert_to_tensor ( input ) ;
610- var input_shape = tensor_util . to_shape ( input_tensor . shape ) ;
610+ var input_shape = input_tensor . shape ;
611611 if ( optimize )
612612 {
613613 if ( input_shape . is_fully_defined ( ) )
@@ -633,7 +633,7 @@ public static Tensor zeros_like(Tensor tensor, TF_DataType dtype = TF_DataType.D
633633 tensor = ops . convert_to_tensor ( tensor , name : "tensor" ) ;
634634
635635 // is_fully_defined return unexpected value.
636- if ( optimize && tensor_util . to_shape ( tensor . shape ) . is_fully_defined ( ) && dtype != TF_DataType . TF_VARIANT )
636+ if ( optimize && tensor . shape . is_fully_defined ( ) && dtype != TF_DataType . TF_VARIANT )
637637 {
638638
639639 }
@@ -933,7 +933,7 @@ public static Tensor[] split(Tensor value, Tensor size_splits, int axis, int num
933933 string name = "split" )
934934 {
935935 if ( num == - 1 )
936- num = size_splits . shape [ 0 ] ;
936+ num = ( int ) size_splits . shape [ 0 ] ;
937937
938938 return gen_array_ops . split_v ( value , size_splits , axis , num , name : name ) ;
939939 }
0 commit comments