@@ -83,7 +83,7 @@ public static Tensor dropout_v2(Tensor x, Tensor rate, Tensor noise_shape = null
83
83
// float to be selected, hence we use a >= comparison.
84
84
var keep_mask = random_tensor >= rate ;
85
85
var ret = x * scale * math_ops . cast ( keep_mask , x . dtype ) ;
86
- ret . SetShape ( x . GetShape ( ) ) ;
86
+ ret . SetShape ( x . TensorShape ) ;
87
87
return ret ;
88
88
} ) ;
89
89
}
@@ -131,14 +131,14 @@ public static Tensor sparse_softmax_cross_entropy_with_logits(Tensor labels = nu
131
131
var precise_logits = logits . dtype == TF_DataType . TF_HALF ? math_ops . cast ( logits , dtypes . float32 ) : logits ;
132
132
133
133
// Store label shape for result later.
134
- var labels_static_shape = labels . GetShape ( ) ;
134
+ var labels_static_shape = labels . TensorShape ;
135
135
var labels_shape = array_ops . shape ( labels ) ;
136
136
/*bool static_shapes_fully_defined = (
137
137
labels_static_shape.is_fully_defined() &&
138
138
logits.get_shape()[:-1].is_fully_defined());*/
139
139
140
140
// Check if no reshapes are required.
141
- if ( logits . GetShape ( ) . NDim == 2 )
141
+ if ( logits . TensorShape . NDim == 2 )
142
142
{
143
143
var ( cost , _) = gen_nn_ops . sparse_softmax_cross_entropy_with_logits (
144
144
precise_logits , labels , name : name ) ;
@@ -163,7 +163,7 @@ public static Tensor softmax_cross_entropy_with_logits_v2_helper(Tensor labels,
163
163
{
164
164
var precise_logits = logits ;
165
165
var input_rank = array_ops . rank ( precise_logits ) ;
166
- var shape = logits . GetShape ( ) ;
166
+ var shape = logits . TensorShape ;
167
167
168
168
if ( axis != - 1 )
169
169
throw new NotImplementedException ( "softmax_cross_entropy_with_logits_v2_helper axis != -1" ) ;
0 commit comments