dense_tensor.mlir 372 字节
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.tensor<X86, NCHW, F32>
  dt.fill_tensor_with_constant.f32 (%a : !Infrt.tensor<X86, NCHW, F32>) {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.tensor<X86, NCHW, F32>)
Y
Yan Chunwei 已提交
7

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