ivy
ivy copied to clipboard
Added trace to Torch frontend
Fixes #4078
I think what happened was I looked at trace and thought "Oh that's simple enough I'll quickly do that" and stopped thinking so in the process I over complicated it, now that you've mentioned it using ivy.trace
is clearly the correct way to do this.
I have genuinely no idea why this PR closed itself, I checked nothing was merged into the main repo, I simply fixed a merge conflict while updating my codebase as this was needed to make the code work, and now it has decided that by pushing this merge into my codebase I have closed this, which was not my intent.
I've made the suggested change, and as helpers.get_dtype("numeric")
won't read the unsupported_dtypes
flag it has the assume("float16" not in dtype)
line as suggested in the internal chat.
The type conversion is done to match Torch's behaviour, and it's done slightly early as a safety measure against overflows, it appears that Torch does the conversion in the same place. Without the int64
conversion Hypothesis will find cases where the dtype
s disagree between Ivy and Torch.
The unsupported_dtypes
flag is ignored because the function _get_dtypes
is only checking in the case where the function is a backend function, should I make a PR to edit make it read the flag in all cases? This screenshot should help make things clearer. In the case that fn
is a frontend function, then _get_dtypes
is invariant in what function fn
actually is.
I've messaged Ved about it
https://github.com/unifyai/ivy/pull/4518
Pulled in change to testing framework from master
The testing weirdness has been resolved, and the CI test passes on this function, it only fails on others.