Import basic TCP pad test

pull/155/head
Aaron J Arthurs 2021-01-27 12:55:26 -06:00 committed by Sean Silva
parent 484fe0d9bd
commit 63ee4f268a
1 changed files with 18 additions and 0 deletions

View File

@ -0,0 +1,18 @@
// RUN: npcomp-run-mlir %s \
// RUN: -invoke pad \
// RUN: -arg-value="dense<[1.2, 3.4]> : tensor<2xf32>" \
// RUN: -shared-libs=%npcomp_runtime_shlib 2>&1 \
// RUN: | FileCheck %s
// CHECK: output #0: dense<
// CHECK-SAME: [0.000000e+00, 1.200000e+00, 3.400000e+00, 0.000000e+00, 0.000000e+00]
// CHECK-SAME: > : tensor<5xf32>
func @pad(%arg0: tensor<?xf32> ) -> tensor<?xf32> {
%lowerExpansion = shape.const_shape [1] : tensor<?xindex>
%upperExpansion = shape.const_shape [2] : tensor<?xindex>
%fillVal = constant 0.0 : f32
%0 = tcp.pad %arg0, %lowerExpansion, %upperExpansion, %fillVal : (tensor<?xf32>, tensor<?xindex>, tensor<?xindex>, f32) -> tensor<?xf32>
return %0 : tensor<?xf32>
}