From e4b7b8db9c5145d6238454de6afdec36fb5bf211 Mon Sep 17 00:00:00 2001 From: zaeemansari70 Date: Mon, 8 Aug 2022 15:11:44 +0500 Subject: [PATCH 1/3] added skeleton files to tensorflow frontend. --- .../frontends/tensorflow/__init__.py | 31 +++++++++++- .../frontends/tensorflow/activations.py | 0 .../frontends/tensorflow/functions.py | 48 ------------------- ivy/functional/frontends/tensorflow/layers.py | 9 ++++ ivy/functional/frontends/tensorflow/linalg.py | 0 ivy/functional/frontends/tensorflow/math.py | 16 +++++++ .../frontends/tensorflow/metrics.py | 0 ivy/functional/frontends/tensorflow/nest.py | 0 ivy/functional/frontends/tensorflow/nn.py | 0 .../frontends/tensorflow/quantization.py | 0 ivy/functional/frontends/tensorflow/random.py | 0 .../frontends/tensorflow/raw_ops.py | 16 +++++++ .../frontends/tensorflow/regularizers.py | 0 ivy/functional/frontends/tensorflow/sets.py | 0 ivy/functional/frontends/tensorflow/signal.py | 0 ivy/functional/frontends/tensorflow/sparse.py | 0 16 files changed, 70 insertions(+), 50 deletions(-) create mode 100644 ivy/functional/frontends/tensorflow/activations.py delete mode 100644 ivy/functional/frontends/tensorflow/functions.py create mode 100644 ivy/functional/frontends/tensorflow/layers.py create mode 100644 ivy/functional/frontends/tensorflow/linalg.py create mode 100644 ivy/functional/frontends/tensorflow/math.py create mode 100644 ivy/functional/frontends/tensorflow/metrics.py create mode 100644 ivy/functional/frontends/tensorflow/nest.py create mode 100644 ivy/functional/frontends/tensorflow/nn.py create mode 100644 ivy/functional/frontends/tensorflow/quantization.py create mode 100644 ivy/functional/frontends/tensorflow/random.py create mode 100644 ivy/functional/frontends/tensorflow/raw_ops.py create mode 100644 ivy/functional/frontends/tensorflow/regularizers.py create mode 100644 ivy/functional/frontends/tensorflow/sets.py create mode 100644 ivy/functional/frontends/tensorflow/signal.py create mode 100644 ivy/functional/frontends/tensorflow/sparse.py diff --git a/ivy/functional/frontends/tensorflow/__init__.py b/ivy/functional/frontends/tensorflow/__init__.py index f358aa6c9b6f6..53a3f9a30be57 100644 --- a/ivy/functional/frontends/tensorflow/__init__.py +++ b/ivy/functional/frontends/tensorflow/__init__.py @@ -1,3 +1,30 @@ # flake8: noqa -from . import functions -from .functions import * +# flake8: noqa +from . import activations +from .activations import * +from . import layers +from .layers import * +from . import linalg +from .linalg import * +from . import math +from .math import * +from . import metrics +from .metrics import * +from . import nest +from .nest import * +from . import nn +from .nn import * +from . import quantization +from .quantization import * +from . import random +from .random import * +from . import raw_ops +from .raw_ops import * +from . import regularizers +from .regularizers import * +from . import sets +from .sets import * +from . import signal +from .signal import * +from . import sparse +from .sparse import * diff --git a/ivy/functional/frontends/tensorflow/activations.py b/ivy/functional/frontends/tensorflow/activations.py new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/ivy/functional/frontends/tensorflow/functions.py b/ivy/functional/frontends/tensorflow/functions.py deleted file mode 100644 index 86a867869878f..0000000000000 --- a/ivy/functional/frontends/tensorflow/functions.py +++ /dev/null @@ -1,48 +0,0 @@ -# global -import ivy - - -def add(x, y, name=None): - return ivy.add(x, y) - - -add.unsupported_dtypes = {"torch": ("float16", "bfloat16")} - - -def tan(x, name=None): - return ivy.tan(x) - - -tan.unsupported_dtypes = {"torch": ("float16", "bfloat16")} - - -def concat(values, axis, name="concat"): - return ivy.concat(values, axis) - - -def fill(dims, value, name="full"): - return ivy.full(dims, value) - - -fill.unsupported_dtypes = {"torch": ("float16", "bfloat16")} - - -def multiply(x, y, name=None): - return ivy.multiply(x, y) - - -multiply.unsupported_dtypes = {"torch": ("float16", "bfloat16")} - - -def subtract(x, y, name=None): - return ivy.subtract(x, y) - - -subtract.unsupported_dtypes = {"torch": ("float16", "bfloat16")} - - -def logical_xor(x, y, name='LogicalXor'): - return ivy.logical_xor(x, y) - - -logical_xor.supported_dtypes = {"torch": ("bool", "bool")} diff --git a/ivy/functional/frontends/tensorflow/layers.py b/ivy/functional/frontends/tensorflow/layers.py new file mode 100644 index 0000000000000..6aeaa6f0de34a --- /dev/null +++ b/ivy/functional/frontends/tensorflow/layers.py @@ -0,0 +1,9 @@ +# global +import ivy + + +def add(x, y, name=None): + return ivy.add(x, y) + + +add.unsupported_dtypes = {"torch": ("float16", "bfloat16")} diff --git a/ivy/functional/frontends/tensorflow/linalg.py b/ivy/functional/frontends/tensorflow/linalg.py new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/ivy/functional/frontends/tensorflow/math.py b/ivy/functional/frontends/tensorflow/math.py new file mode 100644 index 0000000000000..051ebac6d1ea6 --- /dev/null +++ b/ivy/functional/frontends/tensorflow/math.py @@ -0,0 +1,16 @@ +# global +import ivy + + +def add(x, y, name=None): + return ivy.add(x, y) + + +add.unsupported_dtypes = {"torch": ("float16", "bfloat16")} + + +def tan(x, name=None): + return ivy.tan(x) + + +tan.unsupported_dtypes = {"torch": ("float16", "bfloat16")} diff --git a/ivy/functional/frontends/tensorflow/metrics.py b/ivy/functional/frontends/tensorflow/metrics.py new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/ivy/functional/frontends/tensorflow/nest.py b/ivy/functional/frontends/tensorflow/nest.py new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/ivy/functional/frontends/tensorflow/nn.py b/ivy/functional/frontends/tensorflow/nn.py new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/ivy/functional/frontends/tensorflow/quantization.py b/ivy/functional/frontends/tensorflow/quantization.py new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/ivy/functional/frontends/tensorflow/random.py b/ivy/functional/frontends/tensorflow/random.py new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/ivy/functional/frontends/tensorflow/raw_ops.py b/ivy/functional/frontends/tensorflow/raw_ops.py new file mode 100644 index 0000000000000..44cd5b2306e61 --- /dev/null +++ b/ivy/functional/frontends/tensorflow/raw_ops.py @@ -0,0 +1,16 @@ +# global +import ivy + + +def concat(values, axis, name="concat"): + return ivy.concat(values, axis) + + +concat.unsupported_dtypes = {"torch": ("float16", "bfloat16")} + + +def fill(dims, value, name="full"): + return ivy.full(dims, value) + + +fill.unsupported_dtypes = {"torch": ("float16", "bfloat16")} diff --git a/ivy/functional/frontends/tensorflow/regularizers.py b/ivy/functional/frontends/tensorflow/regularizers.py new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/ivy/functional/frontends/tensorflow/sets.py b/ivy/functional/frontends/tensorflow/sets.py new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/ivy/functional/frontends/tensorflow/signal.py b/ivy/functional/frontends/tensorflow/signal.py new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/ivy/functional/frontends/tensorflow/sparse.py b/ivy/functional/frontends/tensorflow/sparse.py new file mode 100644 index 0000000000000..e69de29bb2d1d From 533da392eb761563de98de990279fcd700b51c38 Mon Sep 17 00:00:00 2001 From: zaeemansari70 Date: Tue, 9 Aug 2022 18:58:27 +0500 Subject: [PATCH 2/3] Removed add function from layers.py --- ivy/functional/frontends/tensorflow/layers.py | 9 --------- 1 file changed, 9 deletions(-) diff --git a/ivy/functional/frontends/tensorflow/layers.py b/ivy/functional/frontends/tensorflow/layers.py index 6aeaa6f0de34a..e69de29bb2d1d 100644 --- a/ivy/functional/frontends/tensorflow/layers.py +++ b/ivy/functional/frontends/tensorflow/layers.py @@ -1,9 +0,0 @@ -# global -import ivy - - -def add(x, y, name=None): - return ivy.add(x, y) - - -add.unsupported_dtypes = {"torch": ("float16", "bfloat16")} From 136a9c1c77290dafc00dfbffbb278366553483dc Mon Sep 17 00:00:00 2001 From: zaeemansari70 Date: Wed, 10 Aug 2022 12:32:54 +0500 Subject: [PATCH 3/3] Resolved conflicts and added more math functions --- ivy/functional/frontends/tensorflow/math.py | 28 +++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/ivy/functional/frontends/tensorflow/math.py b/ivy/functional/frontends/tensorflow/math.py index 051ebac6d1ea6..9a195bad00c1b 100644 --- a/ivy/functional/frontends/tensorflow/math.py +++ b/ivy/functional/frontends/tensorflow/math.py @@ -14,3 +14,31 @@ def tan(x, name=None): tan.unsupported_dtypes = {"torch": ("float16", "bfloat16")} + + +def multiply(x, y, name=None): + return ivy.multiply(x, y) + + +multiply.unsupported_dtypes = {"torch": ("float16", "bfloat16")} + + +def subtract(x, y, name=None): + return ivy.subtract(x, y) + + +subtract.unsupported_dtypes = {"torch": ("float16", "bfloat16")} + + +def logical_xor(x, y, name='LogicalXor'): + return ivy.logical_xor(x, y) + + +logical_xor.supported_dtypes = {"torch": ("bool", "bool")} + + +def divide(x, y, name=None): + return ivy.divide(x, y) + + +divide.unsupported_dtypes = {"torch": ("float16", "bfloat16")}