tensor_map.mlir.in 431 字节
Newer Older
1 2 3
// RUN: infrtexec -i %s | FileCheck %s

func @load_tensor_map() {
4
  %map = dt.load_params(){path="@CMAKE_BINARY_DIR@/multi_fc_model"}
5
  %size = dt.tensor_map_get_size(%map) -> i32
6
  Infrt.print.i32 %size
7

8
  %a = dt.tensor_map_get_tensor(%map) {name="fc_bias"} -> !infrt.dense_tensor<CPU, FP32, NCHW>
9 10

  // CHECK: tensor: shape=shape[2], values=[0, 0]
11
  dt.print_tensor (%a : !infrt.dense_tensor<CPU, FP32, NCHW>)
12

13
  Infrt.return
14
}