I have a model with a custom layer with a Metal Shader, have appropriated "class @available(iOS 11.2, *)" and "do not run it in devices with OS bellow 11.2".
Model
Input - Image (Color ...)
Output - MultiArray (Double ...)
Facts
1 - If i put the app targeting some version bellow 11.2, model returns NaN in all entries of the output. On the other end, if i target 11.2, and run on a 12.1 it works as expected.
2 - Targeting <11.2 has an even weider behaviour. If the app is uninstalled and installed, sometimes it returns the correct set of values only one time and after that all predictions will be NaN. You can kill the app and open it and model will always return NaN in all output entries.
3 - If remove "encode" method from MLCustomLayer or set it to run CPU, it runs just fine.
This looks like a bug.
Manuel