dense_tensor.mlir 393 字节
Newer Older
Y
Yan Chunwei 已提交
1 2
// CHECK-LABEL: build_tensor1
func @build_tensor1() {
3 4
  %a = dt.create_uninit_tensor.f32 [3, 4] -> !infrt.dense_tensor<CPU, FP32, NCHW>
  dt.fill_tensor_with_constant.f32 (%a : !infrt.dense_tensor<CPU, FP32, NCHW>) {value=1.0:f32}
Y
Yan Chunwei 已提交
5
  // CHECK: tensor: shape=shape[3,4], values=[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
6
  dt.print_tensor (%a : !infrt.dense_tensor<CPU, FP32, NCHW>)
Y
Yan Chunwei 已提交
7

8
  infrt.return
Y
Yan Chunwei 已提交
9
}