|
| 1 | +# Swift for TensorFlow Known Issues |
| 2 | + |
| 3 | +This is a curated list of known Swift for TensorFlow issues. With every release, |
| 4 | +new issues are added and resolved issues are updated. |
| 5 | + |
| 6 | +Please see the [JIRA issue tracker](https://bugs.swift.org/projects/TF/issues) |
| 7 | +for a full list of known issues. |
| 8 | + |
| 9 | +## Version 0.3 |
| 10 | + |
| 11 | +### TensorFlow Library |
| 12 | + |
| 13 | +* [ ] `Tensor` advanced indexing and striding are not supported on GPU. |
| 14 | + |
| 15 | +## Version 0.2 |
| 16 | + |
| 17 | +### Notebook Environments (Colab and Jupyter) |
| 18 | + |
| 19 | +* [ ] When a runtime error occurs or when you interrupt cell execution, |
| 20 | + resources (e.g. host memory, GPU memory) do not get released. This can |
| 21 | + lead to OOMs. ([TF-338](https://bugs.swift.org/browse/TF-338)) |
| 22 | + * Workaround: Restart the runtime (`Runtime > Restart Runtime` in the Colab |
| 23 | + menu bar) to release all the resources. |
| 24 | +* [ ] If the last statement on a cell evaluates to a struct that was defined in |
| 25 | + the notebook, then you get an error ("use of undeclared type") instead of |
| 26 | + seeing the value of the statement. |
| 27 | + ([TF-125](https://bugs.swift.org/browse/TF-125)) |
| 28 | + * Workaround: Wrap the last statement in `print()`. |
| 29 | +* [ ] Using extensions to conform a type to a protocol (e.g. `extension MyType: |
| 30 | + MyProtocol { ... }`), often causes duplicate conformance errors. |
| 31 | + ([TF-162](https://bugs.swift.org/browse/TF-162)) |
| 32 | + * Workaround: Add the conformance in the same cell where the type is defined. |
| 33 | +* [ ] If a cell that declares a type executes twice, then it creates two |
| 34 | + different types with the same name. Mixing these types can lead to |
| 35 | + confusing error messages like `cannot convert value of type 'MyType' to |
| 36 | + expected argument type 'MyType'`. |
| 37 | + ([TF-156](https://bugs.swift.org/browse/TF-156)) |
| 38 | + * Workaround: Re-run all cells that use the declared type, so that they use the |
| 39 | + new type. |
| 40 | +* [ ] The autocomplete UI should show types and documentation. It should |
| 41 | + position your cursor in the first argument when you complete a function |
| 42 | + call. |
| 43 | + |
| 44 | +### Swift Standard Library Enhancements |
| 45 | + |
| 46 | +* [ ] The |
| 47 | + [`Differentiable`](https://www.tensorflow.org/swift/api_docs/Protocols/Differentiable) |
| 48 | + protocol's `allDifferentiableVariables` requirement should not have a |
| 49 | + setter. Do not use this directly through a generic type with a |
| 50 | + `Differentiable` conformance constraint. |
| 51 | + ([TF-208](https://bugs.swift.org/browse/TF-208)) |
| 52 | + |
| 53 | +### Swift for TensorFlow Deep Learning Library |
| 54 | + |
| 55 | +* [ ] Many Keras layers remain to be implemented, help wanted! |
| 56 | + ([swift-apis#54](https://github.com/tensorflow/swift-apis/issues/54)) |
| 57 | +* [ ] There is no built-in API for parameter sharing. |
| 58 | +* [ ] The |
| 59 | + [`Parameter`](https://www.tensorflow.org/swift/api_docs/Classes/Parameter) |
| 60 | + class does not conform to `Differentiable` yet, and is not recommended for |
| 61 | + general use. |
| 62 | +* [ ] The compiler errors displayed when a user-defined layer struct fails to |
| 63 | + fully satisfy the requirements of the `Layer` protocol are unclear. |
| 64 | + |
| 65 | +### Automatic Differentiation |
| 66 | + |
| 67 | +* [ ] Differentiation does not yet support functions with control flow. |
| 68 | + ([TF-356](https://bugs.swift.org/browse/TF-356)) |
| 69 | +* [ ] Differentiating functions with respect to an `inout` parameter is not yet |
| 70 | + supported. ([TF-357](https://bugs.swift.org/browse/TF-357)) |
| 71 | +* [ ] The compiler will only synthesize conformance requirements for |
| 72 | + `Differentiable` in `struct` types. |
| 73 | + ([TF-37](https://bugs.swift.org/browse/TF-37)) |
| 74 | +* [ ] The `@differentiable` attribute incorrectly passes type-checking in some |
| 75 | + cases, when an error should be produced. This leads to compiler crashes. |
| 76 | + ([TF-449](https://bugs.swift.org/browse/TF-449)) |
| 77 | +* [x] ~~The `@differentiating` attribute leads to a compiler crash when the |
| 78 | + derivative function is defined in a generic context that is more |
| 79 | + constrained than the original function's generic context. |
| 80 | + ([TF-358](https://bugs.swift.org/browse/TF-358))~~ |
| 81 | + * Resolved (v0.3). The `@differentiating` attribute can register derivatives |
| 82 | + with a generic context that is more constrained than the original function's |
| 83 | + generic context. |
| 84 | +* [ ] Referring to a `@differentiable` function using key paths leads to a |
| 85 | + compiler crash. ([TF-123](https://bugs.swift.org/browse/TF-123)) |
| 86 | + |
| 87 | +### Python Interoperability |
| 88 | + |
| 89 | +* [ ] When the execution of a Python expression raises an exception, the stack |
| 90 | + trace will not show the Python call stack. |
| 91 | +* [ ] When an argument to a Python function cannot be converted to a Python |
| 92 | + object, the compiler wrongly claims that the function is of non-function |
| 93 | + type rather than pointing out that the argument doesn't conform to |
| 94 | + `PythonConvertible` ([TF-220](https://bugs.swift.org/browse/TF-220)). |
| 95 | +* [ ] Python TensorFlow cannot be imported because of various issues (binary |
| 96 | + incompatibility, symbol conflicts). |
0 commit comments