Skip to content

Commit

Permalink
small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
akuporos committed Aug 28, 2023
1 parent 6b1ea6a commit 065b42a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
9 changes: 5 additions & 4 deletions docs/snippets/ov_infer_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,16 +55,17 @@ def callback(request, _):
#! [get_set_index_tensor]

data = get_image()
input_tensor_name = "input"

#! [get_set_tensor]
tensor1 = infer_request.get_tensor("res")
tensor1 = infer_request.get_tensor("result")
tensor2 = ov.Tensor(data)
infer_request.set_tensor("data", tensor2)
infer_request.set_tensor(input_tensor_name, tensor2)
#! [get_set_tensor]

#! [get_set_tensor_by_port]
input_port = model.input(0)
output_port = model.input("data")
output_port = model.input(input_tensor_name)
input_tensor = ov.Tensor(data)
infer_request.set_tensor(input_port, input_tensor)
output_tensor = infer_request.get_tensor(output_port)
Expand All @@ -89,7 +90,7 @@ def callback(request, _):
# roi_tensor uses shared memory of input_tensor and describes cropROI
# according to its coordinates **/
roi_tensor = ov.Tensor(input_tensor, begin, end)
infer_request2.set_tensor("data", roi_tensor)
infer_request2.set_tensor(input_tensor_name, roi_tensor)
#! [roi_tensor]

#! [remote_tensor]
Expand Down
4 changes: 2 additions & 2 deletions docs/snippets/ov_preprocessing.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@
# ! [ov:preprocess:build]

# ! [ov:preprocess:input_index]
#ppp.input(1) # Gets 2nd input in a model
#ppp.output(2) # Gets output with index=2 (3rd one) in a model
ppp.input(1) # Gets 2nd input in a model
ppp.output(2) # Gets output with index=2 (3rd one) in a model
# ! [ov:preprocess:input_index]


Expand Down

0 comments on commit 065b42a

Please sign in to comment.