Skip to content

Commit

Permalink
apply comment
Browse files Browse the repository at this point in the history
  • Loading branch information
akuporos committed Jul 31, 2024
1 parent d25ac84 commit 1c4732f
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions docs/articles_en/assets/snippets/ov_custom_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,10 @@ def get_type_info(self):
# ! [op:header]

# ! [op:ctor]
def __init__(self, inputs, attrs=None):
def __init__(self, inputs):
super().__init__(self)
self.set_arguments(inputs)
self.constructor_validate_and_infer_types()
if attrs is not None:
self._attrs = attrs
# ! [op:ctor]

# ! [op:validate]
Expand All @@ -39,8 +37,6 @@ def clone_with_new_inputs(self, new_inputs):

# ! [op:evaluate]
def evaluate(self, outputs, inputs):
if np.array_equal(outputs[0].data, inputs[0].data): # Nothing to do
return True
outputs[0].shape = inputs[0].shape
inputs[0].copy_to(outputs[0])
return True
Expand All @@ -51,7 +47,5 @@ def has_evaluate(self):

# ! [op:visit_attributes]
def visit_attributes(self, visitor):
if hasattr(self, "_attrs"):
visitor.on_attributes(self._attrs)
return True
# ! [op:visit_attributes]

0 comments on commit 1c4732f

Please sign in to comment.