Open 0seba opened 4 months ago
I'm not sure what you're asking. Can you please clarify the question?
Also, please include all code necessary to reproduce the issue.
Input has symbolic value is586 in the last dimension of the shape and output is587. It can be inferred from the convolution parameters that that operation does not modify the shape, so it shouldn't be necessary to create a new symbol and output can also have is586 as last dimension of the shape
Can you share your complete code to reproduce this issue?
In the example above I expect the output's spatial dimension symbol is587
, to be instead the same as the input, is586
.
In the provided code I think only the imports would be missing
from coremltools.converters.mil import Builder as mb
import coremltools.converters.mil as mil
import numpy as np
Situations in which this symbol mismatch causes problem is if I then want to apply operations that require shape matching, like einsum
.
Are you not calling ct.convert
on conv_shape_debug
?
It does convert correctly if I do not use operations like einsum
, but fails to build the program if I do use it. For example, I could have 2 branches with convolutions that maintain the spatial shape, but since new symbols are created from them, I would not be able to use einsum between them because it requires shape matching
Can you share all the code we need to reproduce this issue? Including the ct.convert
call and any thing else needed.
🌱
Hi, according to this PR which looked to be merged, when a convolution does not mutate dimension size for a symbolic shape, no new symbol should be created, but this is not what I seed in the code. So should we expect this behavior or not?
Current implementation of conv shape inference
https://github.com/apple/coremltools/blob/7521b68fba363d4add0c772750d119e4d9815ce6/coremltools/converters/mil/mil/ops/defs/_utils.py#L326-L327
This is a minimal example to verify a new symbol is created