You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
chore: deprecate tensorflow maintenance support (#7989)
**Context:**
We are deprecating `tensorflow` maintenance support and promoting user
migration to `jax` and `torch` interfaces.
**Description of the Change:**
- Add deprecation warning to `QNode` execution. This will capture
majority of user workflows and ensure deprecation visibility.
- Add deprecation warning to
https://docs.pennylane.ai/en/stable/introduction/interfaces/tf.html
- Add deprecation warning in changelog (which will be promoted to
release notes).
- Cleaned up necessary tests to un-block work (this involved deleting TF
specific `all_interfaces` tests).
- Add no cover to TF logic branches
Here's an example,
```python
import pennylane as qml
import tensorflow as tf
dev = qml.device("default.qubit", wires=1)
params = tf.Variable(0.1)
@qml.qnode(dev)
def circuit(x):
qml.RX(x, wires=0)
return qml.expval(qml.PauliZ(0))
circuit(params)
```
```
PennyLaneDeprecationWarning: Support for the TensorFlow interface is deprecated and will be removed in v0.44. Future versions of PennyLane are not guaranteed to work with TensorFlow. Please migrate your workflows to JAX or torch to benefit from enhanced support and features.
circuit(params)
<tf.Tensor: shape=(), dtype=float64, numpy=0.9950041833264242>
```
**Benefits:** No longer have to deal with maintaining TF.
**Possible Drawbacks:**
This could have impact on our eco-system:
Catalyst: N/A
Lightning: PennyLaneAI/pennylane-lightning#1225
QML: Some
[demos](https://github.com/search?q=repo%3APennyLaneAI%2Fqml%20import%20tensorflow&type=code)
need changes. Being taken care of by product here
PennyLaneAI/qml/pull/1505.
Plug-ins: N/A
[sc-92521]
---------
Co-authored-by: Pietropaolo Frisoni <[email protected]>
Co-authored-by: Mudit Pandey <[email protected]>
Co-authored-by: Isaac De Vlugt <[email protected]>
Co-authored-by: Isaac De Vlugt <[email protected]>
0 commit comments