Closed baaj2109 closed 2 years ago
Why are you redefining type_as
? In other words, why do you have the following code segment?
@register_torch_op(override=True)
def type_as(context, node):
inputs = _get_inputs(context, node)
context.add(mb.cast(x=inputs[0], dtype='fp32'), node.name)
This should be necessary.
At any rate, please upgrade to the latest version of the coremltools (pip install -U coremltools
). The outputs of the two models match if you use the latest version of coremltools on macOS 12.
❓Question
I want to use AdaptiveInstanceNorm2d layer to build my model, but when I convert my pytorch model to coreml model, AdaptiveInstanceNorm2d layer got different output than pytorch model
to reproduce:
System Information