-
Notifications
You must be signed in to change notification settings - Fork 713
Open
Labels
bugUnexpected behaviour that should be corrected (type)Unexpected behaviour that should be corrected (type)triagedReviewed and examined, release as been assigned if applicable (status)Reviewed and examined, release as been assigned if applicable (status)
Description
🐞Describing the bug
Reproducer:
import torch
class Model(torch.nn.Module):
def __init__(self):
super().__init__()
def forward(self, x):
return 16 / x.shape[0]
model = Model()
inputs = (
torch.randn(2, 16, 11),
)
eager_outputs = model(*inputs)
ep = torch.jit.trace(model, inputs)
import coremltools as ct
import numpy as np
mlmodel = ct.convert(ep, inputs = [ct.TensorType(shape=[2,16,11])], convert_to='mlprogram')
Result:
ValueError: Op "5" (op_type: inverse) Input x="4" expects tensor or scalar of dtype from type domain ['fp16', 'fp32'] but got tensor[1,int32], inverse, 5
Expected result: conversion success
Note: This was seen in a RoPE implementation, which can neatly be fixed with a conversion to float
coremltools 8.3.0
Metadata
Metadata
Assignees
Labels
bugUnexpected behaviour that should be corrected (type)Unexpected behaviour that should be corrected (type)triagedReviewed and examined, release as been assigned if applicable (status)Reviewed and examined, release as been assigned if applicable (status)