diff options
author | David Majnemer <majnemer@google.com> | 2017-09-26 16:51:50 -0700 |
---|---|---|
committer | TensorFlower Gardener <gardener@tensorflow.org> | 2017-09-26 17:04:33 -0700 |
commit | 0b853efdf0edc7a906a4d08413fa2f1d7f3d9be2 (patch) | |
tree | ee49dea912a83c0e7143ad617cc9e8dd687db394 /tensorflow/compiler/xla/service/shape_inference_test.cc | |
parent | 1ccc394c1010a7d84b71cc193b23578d378c078b (diff) |
[XLA] Split input and output in ConvolutionDimensionNumbers
This allows for additional freedom when reasoning and transforming the input
and output of convolutions.
PiperOrigin-RevId: 170130811
Diffstat (limited to 'tensorflow/compiler/xla/service/shape_inference_test.cc')
-rw-r--r-- | tensorflow/compiler/xla/service/shape_inference_test.cc | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/tensorflow/compiler/xla/service/shape_inference_test.cc b/tensorflow/compiler/xla/service/shape_inference_test.cc index 7c9c7e8d6a..8df4a73229 100644 --- a/tensorflow/compiler/xla/service/shape_inference_test.cc +++ b/tensorflow/compiler/xla/service/shape_inference_test.cc @@ -352,8 +352,10 @@ TEST_F(ShapeInferenceTest, Convolve) { // Dimension order: batch, feature, x0, x1 Shape lhs_shape = ShapeUtil::MakeShape(F32, {10, 11, 3, 4}); - dnums.set_batch_dimension(0); - dnums.set_feature_dimension(1); + dnums.set_input_batch_dimension(0); + dnums.set_output_batch_dimension(0); + dnums.set_input_feature_dimension(1); + dnums.set_output_feature_dimension(1); dnums.add_spatial_dimensions(2); dnums.add_spatial_dimensions(3); @@ -392,8 +394,10 @@ TEST_F(ShapeInferenceTest, ConvolveWithWindowDilation) { // Dimension order: batch, feature, x0, x1 Shape lhs_shape = ShapeUtil::MakeShape(F32, {10, 11, 103, 4}); - dnums.set_batch_dimension(0); - dnums.set_feature_dimension(1); + dnums.set_input_batch_dimension(0); + dnums.set_output_batch_dimension(0); + dnums.set_input_feature_dimension(1); + dnums.set_output_feature_dimension(1); dnums.add_spatial_dimensions(2); dnums.add_spatial_dimensions(3); @@ -433,8 +437,10 @@ TEST_F(ShapeInferenceTest, ConvolveWithBaseDilation) { // Dimension order: batch, feature, x0, x1 Shape lhs_shape = ShapeUtil::MakeShape(F32, {10, 11, 3, 4}); - dnums.set_batch_dimension(0); - dnums.set_feature_dimension(1); + dnums.set_input_batch_dimension(0); + dnums.set_output_batch_dimension(0); + dnums.set_input_feature_dimension(1); + dnums.set_output_feature_dimension(1); dnums.add_spatial_dimensions(2); dnums.add_spatial_dimensions(3); @@ -475,8 +481,10 @@ TEST_F(ShapeInferenceTest, ConvolveDimensionNumbersOverlapError) { Shape rhs_shape = ShapeUtil::MakeShape(F32, {12, 11, 3, 2}); ConvolutionDimensionNumbers dnums; - dnums.set_batch_dimension(3); - dnums.set_feature_dimension(2); + dnums.set_input_batch_dimension(3); + dnums.set_output_batch_dimension(3); + dnums.set_input_feature_dimension(2); + dnums.set_output_feature_dimension(2); dnums.add_spatial_dimensions(0); dnums.add_spatial_dimensions(1); dnums.set_kernel_input_feature_dimension(0); // duplicated with kernel_x0 |