You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

pybind11_modelbin.h 1.6 kB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /* Tencent is pleased to support the open source community by making ncnn available.
  2. *
  3. * Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved.
  4. *
  5. * Licensed under the BSD 3-Clause License (the "License"); you may not use this file except
  6. * in compliance with the License. You may obtain a copy of the License at
  7. *
  8. * https://opensource.org/licenses/BSD-3-Clause
  9. *
  10. * Unless required by applicable law or agreed to in writing, software distributed
  11. * under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
  12. * CONDITIONS OF ANY KIND, either express or implied. See the License for the
  13. * specific language governing permissions and limitations under the License.
  14. */
  15. #ifndef PYBIND11_NCNN_MODELBIN_H
  16. #define PYBIND11_NCNN_MODELBIN_H
  17. #include <modelbin.h>
  18. template<class Base = ncnn::ModelBin>
  19. class PyModelBin : public Base
  20. {
  21. public:
  22. using Base::Base; // Inherit constructors
  23. ncnn::Mat load(int w, int type) const override
  24. {
  25. PYBIND11_OVERRIDE(ncnn::Mat, Base, load, w, type);
  26. }
  27. //ncnn::Mat load(int w, int h, int type) const override {
  28. // PYBIND11_OVERRIDE(ncnn::Mat, Base, load, w, h, type);
  29. //}
  30. //ncnn::Mat load(int w, int h, int c, int type) const override {
  31. // PYBIND11_OVERRIDE(ncnn::Mat, Base, load, w, h, c, type);
  32. //}
  33. };
  34. template<class Other>
  35. class PyModelBinOther : public PyModelBin<Other>
  36. {
  37. public:
  38. using PyModelBin<Other>::PyModelBin;
  39. ncnn::Mat load(int w, int type) const override
  40. {
  41. PYBIND11_OVERRIDE(ncnn::Mat, Other, load, w, type);
  42. }
  43. };
  44. #endif