mmdeploy/csrc/backend_ops/ncnn/onnx2ncnn/shape_inference.h
tpoisonooo cd336eada1
improvement(ViT): use Crop to subtitude Gather (#477)
* improvement(ViT): use Crop to subtitude Gather

* fix(CI): code format

* fix(pytorch/ops/linear.py): bias maybe None

* fix(test/test_pytorch_ops.py): op_type error

* fix(test): pytest error

* fix(test): torch version 1.8
2022-06-02 19:39:15 +08:00

20 lines
509 B
C++

// Copyright (c) OpenMMLab. All rights reserved.
#pragma once
#include "utils.h"
/**
* @brief query output shape of target node
*
* @param mutable_graph
* @param target
* @param weights
* @param context <tensor name, shape>
* @return std::tuple<bool, std::vector<int>>
*/
std::tuple<bool, std::vector<int>> query_shape(
onnx::GraphProto* mutable_graph, onnx::NodeProto* target,
const std::map<std::string, onnx::TensorProto>& weights,
std::map<std::string, std::vector<int>>& context);