openvinotoolkit/openvino

Extend Python API with a new `model.reshape()` overload

Open

#18,347 创建于 2023年7月3日

在 GitHub 查看
 (64 评论) (0 反应) (1 负责人)C++ (3,229 fork)auto 404
category: Python APIgood first issueno_stale

仓库指标

Star
 (10,286 star)
PR 合并指标
 (平均合并 14天 3小时) (30 天内合并 305 个 PR)

描述

Context

Currently there are multiple ways to reshape model inputs in Python API. They are defined as bindings to C++ code.

A new way to reshape has been suggested - implicit input reshaping with a list of input shapes. An example of new, desired overload/Python API function:

  1. model has three inputs: A, B and C
  2. model is being reshaped with a list of shapes: model.reshape([[2,2], [1, 3, 224, 244], [10]])
  3. the given shapes are assigned to respective inputs: A.shape = [2, 2] B.shape = [1, 3, 244, 244] C.shape = [10]

Python API model binding needs to be extended with a new overload which will add this functionality.

What needs to be done?

  1. Add a new overload for model.reshape in model C++ bindings
  2. Add tests for the new functionality in the correct test file - test_model.py
  3. Submit a PR
  4. Wait for review

Resources

Contact points

@p-wysocki @jiwaszki @akuporos

Don't hesitate to reach out, we're here to help!

Ticket: 110444

贡献者指南