Add TensorFlow Frontend Support to Ivy Transpiler #28845
Labels
TensorFlow Frontend
Developing the TensorFlow Frontend, checklist triggered by commenting add_frontend_checklist
ToDo
A ToDo list of tasks
Transpiler
Anything related to transpiling
Description:
The current implementation of
ivy.transpile
supports"torch"
as the solesource
argument. This allows transpiling PyTorch functions or classes to target frameworks like TensorFlow, JAX, or NumPy. This task aims to extend the functionality by adding TensorFlow as a validsource
, enabling transpilation of TensorFlow code to other frameworks via Ivy's intermediate representation.For example, after completing this task, we should be able to transpile TensorFlow code using:
Goals:
The main objective is to implement the first two stages of the transpilation pipeline for TensorFlow:
Once these stages are complete, the rest of the pipeline can be reused to target other frameworks like JAX, PyTorch, or NumPy. The steps would look as follows:
This mirrors the existing pipeline for PyTorch:
Key Tasks:
Add Native Framework-Specific Implementations for Core Transformation Passes:
native_tf_recursive_transformer.py
for traversing and transforming TensorFlow native source code.native_torch_recursive_transformer.py
as a reference (example here)Define the Transformation Pipeline for TensorFlow to TensorFlow Frontend IR:
source_to_frontend_translator_config.py
to handle the stagesource='tensorflow', target='tensorflow_frontend'
(example here).Define the Transformation Pipeline for TensorFlow Frontend IR to Ivy:
frontend_to_ivy_translator_config.py
to handle the stagesource='tensorflow_frontend', target='ivy'
(example here).Add Stateful Classes for TensorFlow's Keras APIs:
keras.Layer
andkeras.Model
APIs that inherit fromivy.Module
.nn.Module
(example here)Understand and Leverage Reusability:
Testing:
Additional Notes:
keras
layers and models.The text was updated successfully, but these errors were encountered: