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

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

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

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

14
  Infrt.return
15
}