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

Patch convert nodes op to allow for ops with private variable names #1593

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 3 additions & 2 deletions coremltools/converters/mil/frontend/torch/ops.py
Expand Up @@ -75,11 +75,12 @@ def convert_nodes(context, graph):
"""
for node in _tqdm(graph.nodes, desc="Converting PyTorch Frontend ==> MIL Ops", unit=" ops"):
op_lookup = node.kind
if op_lookup.endswith("_"):
add_op = _TORCH_OPS_REGISTRY.get(op_lookup, None)
if add_op is None and op_lookup.endswith("_"):
# This is an "in place" op.
# Look up the standard op instead by removing underscore.
op_lookup = op_lookup[:-1]
add_op = _TORCH_OPS_REGISTRY.get(op_lookup, None)
add_op = _TORCH_OPS_REGISTRY.get(op_lookup, None)

_logging.info("Converting op {} : {}".format(node.name, node.kind))
if add_op is None:
Expand Down