helper.h 924 字节
Newer Older
1 2
/**
 * \file imperative/src/test/helper.h
M
Megvii Engine Team 已提交
3
 * MegEngine is Licensed under the Apache License, Version 2.0 (the "License")
4
 *
5
 * Copyright (c) 2014-2021 Megvii Inc. All rights reserved.
6
 *
M
Megvii Engine Team 已提交
7 8 9
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT ARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
 */

#pragma once

#include <variant>

#include "megbrain/imperative.h"
#include "megbrain/test/helper.h"

namespace mgb {
namespace imperative {

class OprChecker {
public:
     using InputSpec = std::variant<HostTensorND, TensorShape>;
     OprChecker(std::shared_ptr<OpDef> opdef);
26
     void run(std::vector<InputSpec> inp_shapes, std::set<size_t> bypass={});
27 28 29 30 31 32 33 34
private:
     std::shared_ptr<OpDef> m_op;
};

} // namespace imperative
} // namespace mgb

// vim: syntax=cpp.doxygen foldmethod=marker foldmarker=f{{{,f}}}