llvm-project
23 строки · 968.0 Байт
1//===- NoInferenceModelRunner.cpp - noop ML model runner ----------------===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8//
9// A pseudo model runner. We use it to store feature values when collecting
10// logs for the default policy, in 'development' mode, but never ask it to
11// 'run'.
12//===----------------------------------------------------------------------===//
13#include "llvm/Analysis/NoInferenceModelRunner.h"14
15using namespace llvm;16
17NoInferenceModelRunner::NoInferenceModelRunner(18LLVMContext &Ctx, const std::vector<TensorSpec> &Inputs)19: MLModelRunner(Ctx, MLModelRunner::Kind::NoOp, Inputs.size()) {20size_t Index = 0;21for (const auto &TS : Inputs)22setUpBufferForTensor(Index++, TS, nullptr);23}
24