@@ -56,7 +56,7 @@ TEST(CommonShapeFnsTest, NoOutputShapeTest) {
5656 .Input ({{" data" , 0 , DT_FLOAT}})
5757 .Finalize (&def));
5858
59- InferenceContext c (&def, op_def, {S ({}), S ({10 })}, {}, {});
59+ InferenceContext c (&def, op_def, {S ({}), S ({10 })}, {}, {}, {}, {} );
6060 TF_EXPECT_OK (NoOutputs (&c));
6161 EXPECT_EQ (0 , c.num_outputs ());
6262}
@@ -74,14 +74,14 @@ TEST(CommonShapeFnsTest, ScalarShapeTest) {
7474 NodeDefBuilder (" test" , " L2Loss" ).Input (" t" , 0 , DT_FLOAT).Finalize (&def));
7575
7676 {
77- InferenceContext c (&def, op_def, {S ({})}, {}, {});
77+ InferenceContext c (&def, op_def, {S ({})}, {}, {}, {}, {} );
7878 TF_EXPECT_OK (ScalarShape (&c));
7979 ShapeHandle output = c.output (0 );
8080 EXPECT_EQ (0 , c.Rank (output));
8181 }
8282
8383 {
84- InferenceContext c (&def, op_def, {S ({1 , 23 , 4 , 4 , 2 })}, {}, {});
84+ InferenceContext c (&def, op_def, {S ({1 , 23 , 4 , 4 , 2 })}, {}, {}, {}, {} );
8585 TF_EXPECT_OK (ScalarShape (&c));
8686 ShapeHandle output = c.output (0 );
8787 EXPECT_EQ (0 , c.Rank (output));
@@ -108,7 +108,7 @@ TEST(CommonShapeFnsTest, MatMulShapeTest) {
108108 .Finalize (&def));
109109
110110 {
111- InferenceContext c (&def, op_def, {S ({2 , 3 }), S ({3 , 4 })}, {}, {});
111+ InferenceContext c (&def, op_def, {S ({2 , 3 }), S ({3 , 4 })}, {}, {}, {}, {} );
112112 TF_EXPECT_OK (MatMulShape (&c));
113113 ShapeHandle output = c.output (0 );
114114 EXPECT_EQ (2 , c.Value (c.Dim (output, 0 )));
@@ -117,7 +117,7 @@ TEST(CommonShapeFnsTest, MatMulShapeTest) {
117117
118118 {
119119 // Unknown inner dimension for one
120- InferenceContext c (&def, op_def, {S ({2 , -1 }), S ({3 , 4 })}, {}, {});
120+ InferenceContext c (&def, op_def, {S ({2 , -1 }), S ({3 , 4 })}, {}, {}, {}, {} );
121121 TF_EXPECT_OK (MatMulShape (&c));
122122 ShapeHandle output = c.output (0 );
123123 EXPECT_EQ (2 , c.Value (c.Dim (output, 0 )));
@@ -126,7 +126,7 @@ TEST(CommonShapeFnsTest, MatMulShapeTest) {
126126
127127 {
128128 // Invalid rank.
129- InferenceContext c (&def, op_def, {S ({2 }), S ({3 , 4 })}, {}, {});
129+ InferenceContext c (&def, op_def, {S ({2 }), S ({3 , 4 })}, {}, {}, {}, {} );
130130 auto s = MatMulShape (&c);
131131 EXPECT_FALSE (s.ok ());
132132 EXPECT_TRUE (
@@ -136,7 +136,7 @@ TEST(CommonShapeFnsTest, MatMulShapeTest) {
136136
137137 {
138138 // Unknown outer dimension
139- InferenceContext c (&def, op_def, {S ({2 , 3 }), S ({3 , -1 })}, {}, {});
139+ InferenceContext c (&def, op_def, {S ({2 , 3 }), S ({3 , -1 })}, {}, {}, {}, {} );
140140 TF_EXPECT_OK (MatMulShape (&c));
141141 ShapeHandle output = c.output (0 );
142142 EXPECT_EQ (2 , c.Value (c.Dim (output, 0 )));
@@ -145,7 +145,7 @@ TEST(CommonShapeFnsTest, MatMulShapeTest) {
145145
146146 {
147147 // Inner shapes not compatible
148- InferenceContext c (&def, op_def, {S ({2 , 5 }), S ({3 , 4 })}, {}, {});
148+ InferenceContext c (&def, op_def, {S ({2 , 5 }), S ({3 , 4 })}, {}, {}, {}, {} );
149149 auto s = MatMulShape (&c);
150150 EXPECT_FALSE (s.ok ());
151151 EXPECT_TRUE (
@@ -156,7 +156,8 @@ TEST(CommonShapeFnsTest, MatMulShapeTest) {
156156
157157 {
158158 // Inner shapes not compatible
159- InferenceContext c (&def, op_def, {S ({2 , 5 , 3 }), S ({3 , 5 , 4 })}, {}, {});
159+ InferenceContext c (&def, op_def, {S ({2 , 5 , 3 }), S ({3 , 5 , 4 })}, {}, {}, {},
160+ {});
160161 auto s = MatMulShape (&c);
161162 EXPECT_FALSE (s.ok ());
162163 EXPECT_TRUE (
@@ -174,7 +175,7 @@ TEST(CommonShapeFnsTest, MatMulShapeTest) {
174175 .Attr (" type" , DT_FLOAT)
175176 .Finalize (&def));
176177
177- InferenceContext c (&def, op_def, {S ({3 , 2 }), S ({3 , 4 })}, {}, {});
178+ InferenceContext c (&def, op_def, {S ({3 , 2 }), S ({3 , 4 })}, {}, {}, {}, {} );
178179 auto s = MatMulShape (&c);
179180 ShapeHandle output = c.output (0 );
180181 EXPECT_EQ (2 , c.Value (c.Dim (output, 0 )));
@@ -191,7 +192,7 @@ TEST(CommonShapeFnsTest, MatMulShapeTest) {
191192 .Attr (" type" , DT_FLOAT)
192193 .Finalize (&def));
193194
194- InferenceContext c (&def, op_def, {S ({2 , 3 }), S ({4 , 3 })}, {}, {});
195+ InferenceContext c (&def, op_def, {S ({2 , 3 }), S ({4 , 3 })}, {}, {}, {}, {} );
195196 auto s = MatMulShape (&c);
196197 ShapeHandle output = c.output (0 );
197198 EXPECT_EQ (2 , c.Value (c.Dim (output, 0 )));
@@ -215,7 +216,7 @@ TEST(CommonShapeFnsTest, BiasAddShapeTest) {
215216 .Finalize (&def));
216217
217218 {
218- InferenceContext c (&def, op_def, {S ({2 , 10 }), S ({10 })}, {}, {});
219+ InferenceContext c (&def, op_def, {S ({2 , 10 }), S ({10 })}, {}, {}, {}, {} );
219220 TF_EXPECT_OK (BiasAddShape (&c));
220221 ShapeHandle output = c.output (0 );
221222 EXPECT_EQ (2 , c.Value (c.Dim (output, 0 )));
@@ -224,15 +225,16 @@ TEST(CommonShapeFnsTest, BiasAddShapeTest) {
224225
225226 {
226227 // Unknown ranks.
227- InferenceContext c (&def, op_def, {Unknown (), Unknown ()}, {}, {});
228+ InferenceContext c (&def, op_def, {Unknown (), Unknown ()}, {}, {}, {}, {} );
228229 TF_EXPECT_OK (BiasAddShape (&c));
229230 ShapeHandle output = c.output (0 );
230231 EXPECT_FALSE (c.RankKnown (output));
231232 }
232233
233234 {
234235 // Rank > 2
235- InferenceContext c (&def, op_def, {S ({4 , 3 , 4 , 2 , 15 }), S ({15 })}, {}, {});
236+ InferenceContext c (&def, op_def, {S ({4 , 3 , 4 , 2 , 15 }), S ({15 })}, {}, {}, {},
237+ {});
236238 TF_EXPECT_OK (BiasAddShape (&c));
237239 ShapeHandle output = c.output (0 );
238240 EXPECT_EQ (" [4,3,4,2,15]" , c.DebugString (output));
@@ -245,7 +247,7 @@ TEST(CommonShapeFnsTest, BiasAddShapeTest) {
245247 .Input (" b" , 0 , DT_FLOAT)
246248 .Attr (" data_format" , " NCHW" )
247249 .Finalize (&def));
248- InferenceContext c (&def, op_def, {S ({2 , 3 , 4 , 5 }), S ({3 })}, {}, {});
250+ InferenceContext c (&def, op_def, {S ({2 , 3 , 4 , 5 }), S ({3 })}, {}, {}, {}, {} );
249251 TF_EXPECT_OK (BiasAddShape (&c));
250252 ShapeHandle output = c.output (0 );
251253 EXPECT_EQ (" [2,3,4,5]" , c.DebugString (output));
@@ -258,8 +260,8 @@ TEST(CommonShapeFnsTest, BiasAddShapeTest) {
258260 .Input (" b" , 0 , DT_FLOAT)
259261 .Attr (" data_format" , " NCHW" )
260262 .Finalize (&def));
261- InferenceContext c (&def, op_def, {S ({8 , 6 , 4 , 2 , 3 , 4 , 5 }), S ({3 })}, {},
262- {});
263+ InferenceContext c (&def, op_def, {S ({8 , 6 , 4 , 2 , 3 , 4 , 5 }), S ({3 })}, {}, {},
264+ {}, {} );
263265 TF_EXPECT_OK (BiasAddShape (&c));
264266 ShapeHandle output = c.output (0 );
265267 EXPECT_EQ (" [8,6,4,2,3,4,5]" , c.DebugString (output));
@@ -272,15 +274,16 @@ TEST(CommonShapeFnsTest, BiasAddShapeTest) {
272274 .Input (" b" , 0 , DT_FLOAT)
273275 .Attr (" data_format" , " NCHW" )
274276 .Finalize (&def));
275- InferenceContext c (&def, op_def, {S ({10 , 11 , 12 }), S ({10 })}, {}, {});
277+ InferenceContext c (&def, op_def, {S ({10 , 11 , 12 }), S ({10 })}, {}, {}, {},
278+ {});
276279 TF_EXPECT_OK (BiasAddShape (&c));
277280 ShapeHandle output = c.output (0 );
278281 EXPECT_EQ (" [10,11,12]" , c.DebugString (output));
279282 }
280283
281284 {
282285 // Input rank not high enough
283- InferenceContext c (&def, op_def, {S ({3 }), S ({3 })}, {}, {});
286+ InferenceContext c (&def, op_def, {S ({3 }), S ({3 })}, {}, {}, {}, {} );
284287 EXPECT_FALSE (BiasAddShape (&c).ok ());
285288 }
286289
@@ -292,7 +295,7 @@ TEST(CommonShapeFnsTest, BiasAddShapeTest) {
292295 .Attr (" data_format" , " NCHW" )
293296 .Finalize (&def));
294297 // NCHW format
295- InferenceContext c (&def, op_def, {S ({2 , 3 }), S ({3 })}, {}, {});
298+ InferenceContext c (&def, op_def, {S ({2 , 3 }), S ({3 })}, {}, {}, {}, {} );
296299 EXPECT_FALSE (BiasAddShape (&c).ok ());
297300 }
298301}
@@ -311,15 +314,15 @@ TEST(CommonShapeFnsTest, BiasAddGradShapeTest) {
311314 .Finalize (&def));
312315
313316 {
314- InferenceContext c (&def, op_def, {S ({2 , 10 })}, {}, {});
317+ InferenceContext c (&def, op_def, {S ({2 , 10 })}, {}, {}, {}, {} );
315318 TF_EXPECT_OK (BiasAddGradShape (&c));
316319 ShapeHandle output = c.output (0 );
317320 EXPECT_EQ (10 , c.Value (c.Dim (output, 0 )));
318321 }
319322
320323 {
321324 // Rank > 2
322- InferenceContext c (&def, op_def, {S ({5 , 7 , 2 , 10 })}, {}, {});
325+ InferenceContext c (&def, op_def, {S ({5 , 7 , 2 , 10 })}, {}, {}, {}, {} );
323326 TF_EXPECT_OK (BiasAddGradShape (&c));
324327 ShapeHandle output = c.output (0 );
325328 EXPECT_EQ (10 , c.Value (c.Dim (output, 0 )));
@@ -331,7 +334,7 @@ TEST(CommonShapeFnsTest, BiasAddGradShapeTest) {
331334 .Input (" a" , 0 , DT_FLOAT)
332335 .Attr (" data_format" , " NCHW" )
333336 .Finalize (&def));
334- InferenceContext c (&def, op_def, {S ({2 , 3 , 4 , 5 })}, {}, {});
337+ InferenceContext c (&def, op_def, {S ({2 , 3 , 4 , 5 })}, {}, {}, {}, {} );
335338 TF_EXPECT_OK (BiasAddGradShape (&c));
336339 ShapeHandle output = c.output (0 );
337340 EXPECT_EQ (3 , c.Value (c.Dim (output, 0 )));
@@ -343,7 +346,8 @@ TEST(CommonShapeFnsTest, BiasAddGradShapeTest) {
343346 .Input (" a" , 0 , DT_FLOAT)
344347 .Attr (" data_format" , " NCHW" )
345348 .Finalize (&def));
346- InferenceContext c (&def, op_def, {S ({8 , 6 , 4 , 2 , 3 , 4 , 5 })}, {}, {});
349+ InferenceContext c (&def, op_def, {S ({8 , 6 , 4 , 2 , 3 , 4 , 5 })}, {}, {}, {},
350+ {});
347351 TF_EXPECT_OK (BiasAddGradShape (&c));
348352 ShapeHandle output = c.output (0 );
349353 EXPECT_EQ (3 , c.Value (c.Dim (output, 0 )));
@@ -355,15 +359,15 @@ TEST(CommonShapeFnsTest, BiasAddGradShapeTest) {
355359 .Input (" a" , 0 , DT_FLOAT)
356360 .Attr (" data_format" , " NCHW" )
357361 .Finalize (&def));
358- InferenceContext c (&def, op_def, {S ({10 , 11 , 12 })}, {}, {});
362+ InferenceContext c (&def, op_def, {S ({10 , 11 , 12 })}, {}, {}, {}, {} );
359363 TF_EXPECT_OK (BiasAddGradShape (&c));
360364 ShapeHandle output = c.output (0 );
361365 EXPECT_EQ (10 , c.Value (c.Dim (output, 0 )));
362366 }
363367
364368 {
365369 // Input rank not high enough
366- InferenceContext c (&def, op_def, {S ({3 })}, {}, {});
370+ InferenceContext c (&def, op_def, {S ({3 })}, {}, {}, {}, {} );
367371 EXPECT_FALSE (BiasAddGradShape (&c).ok ());
368372 }
369373
@@ -374,7 +378,7 @@ TEST(CommonShapeFnsTest, BiasAddGradShapeTest) {
374378 .Attr (" data_format" , " NCHW" )
375379 .Finalize (&def));
376380 // NCHW format
377- InferenceContext c (&def, op_def, {S ({2 , 3 })}, {}, {});
381+ InferenceContext c (&def, op_def, {S ({2 , 3 })}, {}, {}, {}, {} );
378382 EXPECT_FALSE (BiasAddGradShape (&c).ok ());
379383 }
380384}
0 commit comments