@@ -83,7 +83,7 @@ public static Tensor dropout_v2(Tensor x, Tensor rate, Tensor noise_shape = null
8383 // float to be selected, hence we use a >= comparison.
8484 var keep_mask = random_tensor >= rate ;
8585 var ret = x * scale * math_ops . cast ( keep_mask , x . dtype ) ;
86- ret . SetShape ( x . GetShape ( ) ) ;
86+ ret . SetShape ( x . TensorShape ) ;
8787 return ret ;
8888 } ) ;
8989 }
@@ -131,14 +131,14 @@ public static Tensor sparse_softmax_cross_entropy_with_logits(Tensor labels = nu
131131 var precise_logits = logits . dtype == TF_DataType . TF_HALF ? math_ops . cast ( logits , dtypes . float32 ) : logits ;
132132
133133 // Store label shape for result later.
134- var labels_static_shape = labels . GetShape ( ) ;
134+ var labels_static_shape = labels . TensorShape ;
135135 var labels_shape = array_ops . shape ( labels ) ;
136136 /*bool static_shapes_fully_defined = (
137137 labels_static_shape.is_fully_defined() &&
138138 logits.get_shape()[:-1].is_fully_defined());*/
139139
140140 // Check if no reshapes are required.
141- if ( logits . GetShape ( ) . NDim == 2 )
141+ if ( logits . TensorShape . NDim == 2 )
142142 {
143143 var ( cost , _) = gen_nn_ops . sparse_softmax_cross_entropy_with_logits (
144144 precise_logits , labels , name : name ) ;
@@ -163,7 +163,7 @@ public static Tensor softmax_cross_entropy_with_logits_v2_helper(Tensor labels,
163163 {
164164 var precise_logits = logits ;
165165 var input_rank = array_ops . rank ( precise_logits ) ;
166- var shape = logits . GetShape ( ) ;
166+ var shape = logits . TensorShape ;
167167
168168 if ( axis != - 1 )
169169 throw new NotImplementedException ( "softmax_cross_entropy_with_logits_v2_helper axis != -1" ) ;
0 commit comments