Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request]: Convolution #24296

Open
1 task done
lcx1874000 opened this issue Apr 29, 2024 · 1 comment
Open
1 task done

[Feature Request]: Convolution #24296

lcx1874000 opened this issue Apr 29, 2024 · 1 comment
Assignees
Labels
category: Python API OpenVINO Python bindings enhancement New feature or request feature New feature request

Comments

@lcx1874000
Copy link

Request Description

class ov::op::v1::Convolution。Convolution, can you use this API like torch.nn.Conv2d in Pytorch? I refer to the build model in the official example. This method requires compile_model. I want to call this convolution separately. I looked at the documentation but could not find the relevant interface. Do you support the above operations

Feature Use Case

Convolution, can you use this API like torch.nn.Conv2d in Pytorch?

Issue submission checklist

  • The feature request or improvement must be related to OpenVINO
@lcx1874000 lcx1874000 added enhancement New feature or request feature New feature request labels Apr 29, 2024
@ilya-lavrenov ilya-lavrenov added the category: PyTorch FE OpenVINO PyTorch Frontend label Apr 29, 2024
@rkazants
Copy link
Contributor

Hi @lcx1874000,

As I understand, you want to create the single layer model that contain OV Convolution and run it for inference. Here is an example how to create the single layer model with Divide operation:

import numpy as np
import openvino.runtime.opset9 as ov
from openvino.runtime import Model, Core

# create a model with TopK
x = ov.parameter([1], name="x", dtype=np.int32)
y = ov.parameter([1], name="y", dtype=np.int32)
divide = ov.divide(x, y)
model = Model([divide], [x, y], "model")

# infer it on CPU
core = Core()
compiled_model = core.compile_model(model, "CPU")
output = compiled_model.infer_new_request({0: np.array([4], dtype=np.int32), 1: np.array([-3], dtype=np.int32)})

Since you want to create with Convolution, please refer to Convolution Python documentation: https://docs.openvino.ai/2024/api/ie_python_api/_autosummary/openvino.runtime.opset14.convolution.html
Examples with convolution in test: https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/python/tests/test_graph/test_convolution.py

Pay attention that we have no eager execution mode for inference.
Please elaborate your request more if I missed somenthing.

Best regards,
Roman

@mvafin mvafin added category: Python API OpenVINO Python bindings and removed category: PyTorch FE OpenVINO PyTorch Frontend labels Apr 30, 2024
@mvafin mvafin removed their assignment Apr 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: Python API OpenVINO Python bindings enhancement New feature or request feature New feature request
Projects
None yet
Development

No branches or pull requests

4 participants