apple / apple/coremltools

mb.identity breaks when complex_input.real is None

Open
#2,262 0 comments 0 reactions 0 assignees View on GitHub
feature request
Dominant language
Python
Stars
5.4k
Forks
850
Avg merge
4d 5h
Merged PRs (30d)
10

Description

@LowerComplex.register_lower_func(op_type="complex_real")
def _lower_complex_real(op: Operation):
complex_input: ComplexVar = op.data
# Use an identity op to avoid the block's input name inconsistency issue. If we directly use
# complex_input.real, the var's name could be inconsistent with the block's input name.
breakpoint()
if complex_input.real==None:
breakpoint()
return mb.identity(x=None, before_op=op)
result = mb.identity(x=complex_input.real, before_op=op)
return result

also mb.identity breaks when complex_input.real is None, can we have a workaround for this? @junpeiz

Contributor guide

Open the contributing guide

Research direction

Start at _lower_complex_real and trace the mb.identity call when complex_input.real is None. Reproduce the failure in the model-conversion path and determine a supported workaround for that case; done means conversion no longer breaks.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
machine-learning
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.