We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Wrong key-word argument `name` in `ivy.remainder()` function call
In the following line, the name argument is passed,
https://github.com/unifyai/ivy/blob/bec4752711c314f01298abc3845f02c24a99acab/ivy/functional/frontends/tensorflow/variable.py#L191
From the actual function definition, there is no such argument
https://github.com/unifyai/ivy/blob/8ff497a8c592b75f010160b313dc431218c2b475/ivy/functional/ivy/elementwise.py#L5415-L5422

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `ivy/functional/frontends/tensorflow/variable.py`
Content:
```
1 # global
2 
3 # local
4 import ivy
5 import ivy.functional.frontends.tensorflow as tf_frontend
6 
7 
8 class Variable:
9     def __init__(self, array, trainable=True, name=None, dtype=None):
10         self._ivy_array = (
11             ivy.array(array) if not isinstance(array, ivy.Array) else array
12         )
13         self._ivy_array = (
14             ivy.astype(self._ivy_array, dtype) if dtype is not None else self._ivy_array
15         )
16         self.trainable = trainable
17 
18     def __repr__(self):
19         return (
20             repr(self._ivy_array).replace(
21                 "ivy.array", "ivy.frontends.tensorflow.Variable"
22             )[:-1]
23             + ", shape="
24             + str(self._ivy_array.shape)
25             + ", dtype="
26             + str(self._ivy_array.dtype)
27             + ")"
28         )
29 
30     # Properties #
31     # ---------- #
32 
33     @property
34     def ivy_array(self):
35         return self._ivy_array
36 
37     @property
38     def device(self):
39         return self._ivy_array.device
40 
41     @property
42     def dtype(self):
43         return tf_frontend.DType(
44             tf_frontend.tensorflow_type_to_enum[self._ivy_array.dtype]
45         )
46 
47     @property
48     def shape(self):
49         return self._ivy_array.shape
50 
51     # Instance Methods #
52     # ---------------- #
53 
54     def assign(self, value, use_locking=None, name=None, read_value=True):
55         ivy.utils.assertions.check_equal(
56             value.shape if hasattr(value, "ivy_array") else ivy.shape(value),
57             self.shape,
58             as_array=False,
59         )
60         self._ivy_array = value._ivy_array
61 
62     def assign_add(self, delta, use_locking=None, name=None, read_value=True):
63         ivy.utils.assertions.check_equal(
64             delta.shape if hasattr(delta, "ivy_array") else ivy.shape(delta),
65             self.shape,
66             as_array=False,
67         )
68         self._ivy_array = tf_frontend.math.add(self._ivy_array, delta._ivy_array)
69 
70     def assign_sub(self, delta, use_locking=None, name=None, read_value=True):
71         ivy.utils.assertions.check_equal(
72             delta.shape if hasattr(delta, "ivy_array") else ivy.shape(delta),
73             self.shape,
74             as_array=False,
75         )
76         self._ivy_array = tf_frontend.math.subtract(self._ivy_array, delta._ivy_array)
77 
78     def batch_scatter_update(
79         self, sparse_delta, use_locking=None, name=None, read_value=True
80     ):
81         pass
82 
83     def gather_nd(self, indices, name=None):
84         return tf_frontend.gather_nd(params=self._ivy_array, indices=indices)
85 
86     def read_value(self):
87         return tf_frontend.Tensor(self._ivy_array)
88 
89     def scatter_add(self, sparse_delta, use_locking=None, name=None, read_value=True):
90         pass
91 
92     def scatter_div(self, sparse_delta, use_locking=None, name=None, read_value=True):
93         pass
94 
95     def scatter_max(self, sparse_delta, use_locking=None, name=None, read_value=True):
96         pass
97 
98     def scatter_min(self, sparse_delta, use_locking=None, name=None, read_value=True):
99         pass
100 
101     def scatter_mul(self, sparse_delta, use_locking=None, name=None, read_value=True):
102         pass
103 
104     def scatter_nd_add(self, indices, updates, use_locking=None, name=None):
105         pass
106 
107     def scatter_nd_sub(self, indices, updates, use_locking=None, name=None):
108         pass
109 
110     def scatter_nd_update(self, indices, updates, use_locking=None, name=None):
111         pass
112 
113     def scatter_sub(self, sparse_delta, use_locking=None, name=None, read_value=True):
114         pass
115 
116     def scatter_update(
117         self, sparse_delta, use_locking=None, name=None, read_value=True
118     ):
119         pass
120 
121     def set_shape(self, shape):
122         if shape is None:
123             return
124 
125         x_shape = self._ivy_array.shape
126         if len(x_shape) != len(shape):
127             raise ValueError(
128                 f"Tensor's shape {x_shape} is not compatible with supplied shape "
129                 f"{shape}."
130             )
131         for i, v in enumerate(x_shape):
132             if v != shape[i] and (shape[i] is not None):
133                 raise ValueError(
134                     f"Tensor's shape {x_shape} is not compatible with supplied shape "
135                     f"{shape}."
136                 )
137 
138     def get_shape(self):
139         return self._ivy_array.shape
140 
141     def sparse_read(self, indices, name=None):
142         pass
143 
144     def __add__(self, y, name="add"):
145         return self.__radd__(y)
146 
147     def __div__(self, x, name="div"):
148         return tf_frontend.math.divide(x, self._ivy_array, name=name)
149 
150     def __and__(self, y, name="and"):
151         return y.__rand__(self._ivy_array)
152 
153     def __eq__(self, other):
154         return tf_frontend.raw_ops.Equal(
155             x=self._ivy_array, y=other, incompatible_shape_error=False
156         )
157 
158     def __floordiv__(self, y, name="floordiv"):
159         return y.__rfloordiv__(self._ivy_array)
160 
161     def __ge__(self, y, name="ge"):
162         return tf_frontend.raw_ops.GreaterEqual(
163             x=self._ivy_array, y=y._ivy_array, name=name
164         )
165 
166     def __getitem__(self, slice_spec, var=None, name="getitem"):
167         ret = ivy.get_item(self._ivy_array, slice_spec)
168         return Variable(ivy.array(ret, dtype=ivy.dtype(ret), copy=False))
169 
170     def __gt__(self, y, name="gt"):
171         return tf_frontend.raw_ops.Greater(x=self._ivy_array, y=y._ivy_array, name=name)
172 
173     def __invert__(self, name="invert"):
174         return tf_frontend.raw_ops.Invert(x=self._ivy_array, name=name)
175 
176     def __le__(self, y, name="le"):
177         return tf_frontend.raw_ops.LessEqual(
178             x=self._ivy_array, y=y._ivy_array, name=name
179         )
180 
181     def __lt__(self, y, name="lt"):
182         return tf_frontend.raw_ops.Less(x=self._ivy_array, y=y._ivy_array, name=name)
183 
184     def __matmul__(self, y, name="matmul"):
185         return y.__rmatmul__(self._ivy_array)
186 
187     def __mul__(self, x, name="mul"):
188         return tf_frontend.math.multiply(x, self._ivy_array, name=name)
189 
190     def __mod__(self, x, name="mod"):
191         return ivy.remainder(x, self._ivy_array, name=name)
192 
193     def __ne__(self, other):
194         return tf_frontend.raw_ops.NotEqual(
195             x=self._ivy_array, y=other._ivy_array, incompatible_shape_error=False
196         )
197 
198     def __neg__(self, name="neg"):
199         return tf_frontend.raw_ops.Neg(x=self._ivy_array, name=name)
200 
201     def __or__(self, y, name="or"):
202         return y.__ror__(self._ivy_array)
203 
204     def __pow__(self, y, name="pow"):
205         return tf_frontend.math.pow(x=self, y=y, name=name)
206 
207     def __radd__(self, x, name="radd"):
208         return tf_frontend.math.add(x, self._ivy_array, name=name)
209 
210     def __rand__(self, x, name="rand"):
211         return tf_frontend.math.logical_and(x, self._ivy_array, name=name)
212 
213     def __rfloordiv__(self, x, name="rfloordiv"):
214         return tf_frontend.raw_ops.FloorDiv(x=x, y=self._ivy_array, name=name)
215 
216     def __rmatmul__(self, x, name="rmatmul"):
217         return tf_frontend.raw_ops.MatMul(a=x, b=self._ivy_array, name=name)
218 
219     def __rmul__(self, x, name="rmul"):
220         return tf_frontend.raw_ops.Mul(x=x, y=self._ivy_array, name=name)
221 
222     def __ror__(self, x, name="ror"):
223         return tf_frontend.raw_ops.LogicalOr(x=x, y=self._ivy_array, name=name)
224 
225     def __rpow__(self, x, name="rpow"):
226         return tf_frontend.raw_ops.Pow(x=x, y=self._ivy_array, name=name)
227 
228     def __rsub__(self, x, name="rsub"):
229         return tf_frontend.math.subtract(x, self._ivy_array, name=name)
230 
231     def __rtruediv__(self, x, name="rtruediv"):
232         return tf_frontend.math.truediv(x, self._ivy_array, name=name)
233 
234     def __rxor__(self, x, name="rxor"):
235         return tf_frontend.math.logical_xor(x, self._ivy_array, name=name)
236 
237     def __sub__(self, y, name="sub"):
238         return y.__rsub__(self._ivy_array)
239 
240     def __truediv__(self, y, name="truediv"):
241         dtype = ivy.dtype(self._ivy_array)
242         if dtype in [ivy.uint8, ivy.int8, ivy.uint16, ivy.int16]:
243             return ivy.astype(y, ivy.float32).__rtruediv__(
244                 ivy.astype(self._ivy_array, ivy.float32)
245             )
246         if dtype in [ivy.uint32, ivy.int32, ivy.uint64, ivy.int64]:
247             return ivy.astype(y, ivy.float64).__rtruediv__(
248                 ivy.astype(self._ivy_array, ivy.float64)
249             )
250         return y.__rtruediv__(self._ivy_array)
251 
252     def __xor__(self, y, name="xor"):
253         return y.__rxor__(self._ivy_array)
254 
255     def __setitem__(self, key, value):
256         raise ivy.utils.exceptions.IvyException(
257             "ivy.functional.frontends.tensorflow.Variable object "
258             "doesn't support assignment"
259         )
260 
261 
262 class IndexedSlices:
263     def __init__(self, values, indices, dense_shape=None):
264         self._values = values
265         self._indices = indices
266         self._dense_shape = dense_shape
267 
268     @property
269     def values(self):
270         """A `Tensor` containing the values of the slices."""
271         return self._values
272 
273     @property
274     def indices(self):
275         """A 1-D `Tensor` containing the indices of the slices."""
276         return self._indices
277 
278     @property
279     def dense_shape(self):
280         """A 1-D `Tensor` containing the shape of the corresponding dense
281         tensor."""
282         return self._dense_shape
283 
284     @property
285     def device(self):
286         """The name of the device on which `values` will be produced, or
287         `None`."""
288         return self.values.device
289 
290     @property
291     def dtype(self):
292         """The `DType` of elements in this tensor."""
293         return self.values.dtype
294 
295     def __repr__(self):
296         return "IndexedSlices(\nindices=%s,\nvalues=%s%s\n)" % (
297             self._indices,
298             self._values,
299             (
300                 f", dense_shape={self._dense_shape}"
301                 if self._dense_shape is not None
302                 else ""
303             ),
304         )
305 
306     def __neg__(self):
307         return IndexedSlices(-self._values, self._indices, self._dense_shape)
308
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/ivy/functional/frontends/tensorflow/variable.py b/ivy/functional/frontends/tensorflow/variable.py
--- a/ivy/functional/frontends/tensorflow/variable.py
+++ b/ivy/functional/frontends/tensorflow/variable.py
@@ -188,7 +188,7 @@
         return tf_frontend.math.multiply(x, self._ivy_array, name=name)
 
     def __mod__(self, x, name="mod"):
-        return ivy.remainder(x, self._ivy_array, name=name)
+        return tf_frontend.math.mod(x, self._ivy_array, name=name)
 
     def __ne__(self, other):
         return tf_frontend.raw_ops.NotEqual(

{"golden_diff": "diff --git a/ivy/functional/frontends/tensorflow/variable.py b/ivy/functional/frontends/tensorflow/variable.py\n--- a/ivy/functional/frontends/tensorflow/variable.py\n+++ b/ivy/functional/frontends/tensorflow/variable.py\n@@ -188,7 +188,7 @@\n         return tf_frontend.math.multiply(x, self._ivy_array, name=name)\n \n     def __mod__(self, x, name=\"mod\"):\n-        return ivy.remainder(x, self._ivy_array, name=name)\n+        return tf_frontend.math.mod(x, self._ivy_array, name=name)\n \n     def __ne__(self, other):\n         return tf_frontend.raw_ops.NotEqual(\n", "issue": "Wrong key-word argument `name` in `ivy.remainder()` function call\nIn the following line, the name argument is passed,\r\nhttps://github.com/unifyai/ivy/blob/bec4752711c314f01298abc3845f02c24a99acab/ivy/functional/frontends/tensorflow/variable.py#L191\r\nFrom the actual function definition, there is no such argument\r\nhttps://github.com/unifyai/ivy/blob/8ff497a8c592b75f010160b313dc431218c2b475/ivy/functional/ivy/elementwise.py#L5415-L5422\n", "before_files": [{"content": "# global\n\n# local\nimport ivy\nimport ivy.functional.frontends.tensorflow as tf_frontend\n\n\nclass Variable:\n    def __init__(self, array, trainable=True, name=None, dtype=None):\n        self._ivy_array = (\n            ivy.array(array) if not isinstance(array, ivy.Array) else array\n        )\n        self._ivy_array = (\n            ivy.astype(self._ivy_array, dtype) if dtype is not None else self._ivy_array\n        )\n        self.trainable = trainable\n\n    def __repr__(self):\n        return (\n            repr(self._ivy_array).replace(\n                \"ivy.array\", \"ivy.frontends.tensorflow.Variable\"\n            )[:-1]\n            + \", shape=\"\n            + str(self._ivy_array.shape)\n            + \", dtype=\"\n            + str(self._ivy_array.dtype)\n            + \")\"\n        )\n\n    # Properties #\n    # ---------- #\n\n    @property\n    def ivy_array(self):\n        return self._ivy_array\n\n    @property\n    def device(self):\n        return self._ivy_array.device\n\n    @property\n    def dtype(self):\n        return tf_frontend.DType(\n            tf_frontend.tensorflow_type_to_enum[self._ivy_array.dtype]\n        )\n\n    @property\n    def shape(self):\n        return self._ivy_array.shape\n\n    # Instance Methods #\n    # ---------------- #\n\n    def assign(self, value, use_locking=None, name=None, read_value=True):\n        ivy.utils.assertions.check_equal(\n            value.shape if hasattr(value, \"ivy_array\") else ivy.shape(value),\n            self.shape,\n            as_array=False,\n        )\n        self._ivy_array = value._ivy_array\n\n    def assign_add(self, delta, use_locking=None, name=None, read_value=True):\n        ivy.utils.assertions.check_equal(\n            delta.shape if hasattr(delta, \"ivy_array\") else ivy.shape(delta),\n            self.shape,\n            as_array=False,\n        )\n        self._ivy_array = tf_frontend.math.add(self._ivy_array, delta._ivy_array)\n\n    def assign_sub(self, delta, use_locking=None, name=None, read_value=True):\n        ivy.utils.assertions.check_equal(\n            delta.shape if hasattr(delta, \"ivy_array\") else ivy.shape(delta),\n            self.shape,\n            as_array=False,\n        )\n        self._ivy_array = tf_frontend.math.subtract(self._ivy_array, delta._ivy_array)\n\n    def batch_scatter_update(\n        self, sparse_delta, use_locking=None, name=None, read_value=True\n    ):\n        pass\n\n    def gather_nd(self, indices, name=None):\n        return tf_frontend.gather_nd(params=self._ivy_array, indices=indices)\n\n    def read_value(self):\n        return tf_frontend.Tensor(self._ivy_array)\n\n    def scatter_add(self, sparse_delta, use_locking=None, name=None, read_value=True):\n        pass\n\n    def scatter_div(self, sparse_delta, use_locking=None, name=None, read_value=True):\n        pass\n\n    def scatter_max(self, sparse_delta, use_locking=None, name=None, read_value=True):\n        pass\n\n    def scatter_min(self, sparse_delta, use_locking=None, name=None, read_value=True):\n        pass\n\n    def scatter_mul(self, sparse_delta, use_locking=None, name=None, read_value=True):\n        pass\n\n    def scatter_nd_add(self, indices, updates, use_locking=None, name=None):\n        pass\n\n    def scatter_nd_sub(self, indices, updates, use_locking=None, name=None):\n        pass\n\n    def scatter_nd_update(self, indices, updates, use_locking=None, name=None):\n        pass\n\n    def scatter_sub(self, sparse_delta, use_locking=None, name=None, read_value=True):\n        pass\n\n    def scatter_update(\n        self, sparse_delta, use_locking=None, name=None, read_value=True\n    ):\n        pass\n\n    def set_shape(self, shape):\n        if shape is None:\n            return\n\n        x_shape = self._ivy_array.shape\n        if len(x_shape) != len(shape):\n            raise ValueError(\n                f\"Tensor's shape {x_shape} is not compatible with supplied shape \"\n                f\"{shape}.\"\n            )\n        for i, v in enumerate(x_shape):\n            if v != shape[i] and (shape[i] is not None):\n                raise ValueError(\n                    f\"Tensor's shape {x_shape} is not compatible with supplied shape \"\n                    f\"{shape}.\"\n                )\n\n    def get_shape(self):\n        return self._ivy_array.shape\n\n    def sparse_read(self, indices, name=None):\n        pass\n\n    def __add__(self, y, name=\"add\"):\n        return self.__radd__(y)\n\n    def __div__(self, x, name=\"div\"):\n        return tf_frontend.math.divide(x, self._ivy_array, name=name)\n\n    def __and__(self, y, name=\"and\"):\n        return y.__rand__(self._ivy_array)\n\n    def __eq__(self, other):\n        return tf_frontend.raw_ops.Equal(\n            x=self._ivy_array, y=other, incompatible_shape_error=False\n        )\n\n    def __floordiv__(self, y, name=\"floordiv\"):\n        return y.__rfloordiv__(self._ivy_array)\n\n    def __ge__(self, y, name=\"ge\"):\n        return tf_frontend.raw_ops.GreaterEqual(\n            x=self._ivy_array, y=y._ivy_array, name=name\n        )\n\n    def __getitem__(self, slice_spec, var=None, name=\"getitem\"):\n        ret = ivy.get_item(self._ivy_array, slice_spec)\n        return Variable(ivy.array(ret, dtype=ivy.dtype(ret), copy=False))\n\n    def __gt__(self, y, name=\"gt\"):\n        return tf_frontend.raw_ops.Greater(x=self._ivy_array, y=y._ivy_array, name=name)\n\n    def __invert__(self, name=\"invert\"):\n        return tf_frontend.raw_ops.Invert(x=self._ivy_array, name=name)\n\n    def __le__(self, y, name=\"le\"):\n        return tf_frontend.raw_ops.LessEqual(\n            x=self._ivy_array, y=y._ivy_array, name=name\n        )\n\n    def __lt__(self, y, name=\"lt\"):\n        return tf_frontend.raw_ops.Less(x=self._ivy_array, y=y._ivy_array, name=name)\n\n    def __matmul__(self, y, name=\"matmul\"):\n        return y.__rmatmul__(self._ivy_array)\n\n    def __mul__(self, x, name=\"mul\"):\n        return tf_frontend.math.multiply(x, self._ivy_array, name=name)\n\n    def __mod__(self, x, name=\"mod\"):\n        return ivy.remainder(x, self._ivy_array, name=name)\n\n    def __ne__(self, other):\n        return tf_frontend.raw_ops.NotEqual(\n            x=self._ivy_array, y=other._ivy_array, incompatible_shape_error=False\n        )\n\n    def __neg__(self, name=\"neg\"):\n        return tf_frontend.raw_ops.Neg(x=self._ivy_array, name=name)\n\n    def __or__(self, y, name=\"or\"):\n        return y.__ror__(self._ivy_array)\n\n    def __pow__(self, y, name=\"pow\"):\n        return tf_frontend.math.pow(x=self, y=y, name=name)\n\n    def __radd__(self, x, name=\"radd\"):\n        return tf_frontend.math.add(x, self._ivy_array, name=name)\n\n    def __rand__(self, x, name=\"rand\"):\n        return tf_frontend.math.logical_and(x, self._ivy_array, name=name)\n\n    def __rfloordiv__(self, x, name=\"rfloordiv\"):\n        return tf_frontend.raw_ops.FloorDiv(x=x, y=self._ivy_array, name=name)\n\n    def __rmatmul__(self, x, name=\"rmatmul\"):\n        return tf_frontend.raw_ops.MatMul(a=x, b=self._ivy_array, name=name)\n\n    def __rmul__(self, x, name=\"rmul\"):\n        return tf_frontend.raw_ops.Mul(x=x, y=self._ivy_array, name=name)\n\n    def __ror__(self, x, name=\"ror\"):\n        return tf_frontend.raw_ops.LogicalOr(x=x, y=self._ivy_array, name=name)\n\n    def __rpow__(self, x, name=\"rpow\"):\n        return tf_frontend.raw_ops.Pow(x=x, y=self._ivy_array, name=name)\n\n    def __rsub__(self, x, name=\"rsub\"):\n        return tf_frontend.math.subtract(x, self._ivy_array, name=name)\n\n    def __rtruediv__(self, x, name=\"rtruediv\"):\n        return tf_frontend.math.truediv(x, self._ivy_array, name=name)\n\n    def __rxor__(self, x, name=\"rxor\"):\n        return tf_frontend.math.logical_xor(x, self._ivy_array, name=name)\n\n    def __sub__(self, y, name=\"sub\"):\n        return y.__rsub__(self._ivy_array)\n\n    def __truediv__(self, y, name=\"truediv\"):\n        dtype = ivy.dtype(self._ivy_array)\n        if dtype in [ivy.uint8, ivy.int8, ivy.uint16, ivy.int16]:\n            return ivy.astype(y, ivy.float32).__rtruediv__(\n                ivy.astype(self._ivy_array, ivy.float32)\n            )\n        if dtype in [ivy.uint32, ivy.int32, ivy.uint64, ivy.int64]:\n            return ivy.astype(y, ivy.float64).__rtruediv__(\n                ivy.astype(self._ivy_array, ivy.float64)\n            )\n        return y.__rtruediv__(self._ivy_array)\n\n    def __xor__(self, y, name=\"xor\"):\n        return y.__rxor__(self._ivy_array)\n\n    def __setitem__(self, key, value):\n        raise ivy.utils.exceptions.IvyException(\n            \"ivy.functional.frontends.tensorflow.Variable object \"\n            \"doesn't support assignment\"\n        )\n\n\nclass IndexedSlices:\n    def __init__(self, values, indices, dense_shape=None):\n        self._values = values\n        self._indices = indices\n        self._dense_shape = dense_shape\n\n    @property\n    def values(self):\n        \"\"\"A `Tensor` containing the values of the slices.\"\"\"\n        return self._values\n\n    @property\n    def indices(self):\n        \"\"\"A 1-D `Tensor` containing the indices of the slices.\"\"\"\n        return self._indices\n\n    @property\n    def dense_shape(self):\n        \"\"\"A 1-D `Tensor` containing the shape of the corresponding dense\n        tensor.\"\"\"\n        return self._dense_shape\n\n    @property\n    def device(self):\n        \"\"\"The name of the device on which `values` will be produced, or\n        `None`.\"\"\"\n        return self.values.device\n\n    @property\n    def dtype(self):\n        \"\"\"The `DType` of elements in this tensor.\"\"\"\n        return self.values.dtype\n\n    def __repr__(self):\n        return \"IndexedSlices(\\nindices=%s,\\nvalues=%s%s\\n)\" % (\n            self._indices,\n            self._values,\n            (\n                f\", dense_shape={self._dense_shape}\"\n                if self._dense_shape is not None\n                else \"\"\n            ),\n        )\n\n    def __neg__(self):\n        return IndexedSlices(-self._values, self._indices, self._dense_shape)\n", "path": "ivy/functional/frontends/tensorflow/variable.py"}], "after_files": [{"content": "# global\n\n# local\nimport ivy\nimport ivy.functional.frontends.tensorflow as tf_frontend\n\n\nclass Variable:\n    def __init__(self, array, trainable=True, name=None, dtype=None):\n        self._ivy_array = (\n            ivy.array(array) if not isinstance(array, ivy.Array) else array\n        )\n        self._ivy_array = (\n            ivy.astype(self._ivy_array, dtype) if dtype is not None else self._ivy_array\n        )\n        self.trainable = trainable\n\n    def __repr__(self):\n        return (\n            repr(self._ivy_array).replace(\n                \"ivy.array\", \"ivy.frontends.tensorflow.Variable\"\n            )[:-1]\n            + \", shape=\"\n            + str(self._ivy_array.shape)\n            + \", dtype=\"\n            + str(self._ivy_array.dtype)\n            + \")\"\n        )\n\n    # Properties #\n    # ---------- #\n\n    @property\n    def ivy_array(self):\n        return self._ivy_array\n\n    @property\n    def device(self):\n        return self._ivy_array.device\n\n    @property\n    def dtype(self):\n        return tf_frontend.DType(\n            tf_frontend.tensorflow_type_to_enum[self._ivy_array.dtype]\n        )\n\n    @property\n    def shape(self):\n        return self._ivy_array.shape\n\n    # Instance Methods #\n    # ---------------- #\n\n    def assign(self, value, use_locking=None, name=None, read_value=True):\n        ivy.utils.assertions.check_equal(\n            value.shape if hasattr(value, \"ivy_array\") else ivy.shape(value),\n            self.shape,\n            as_array=False,\n        )\n        self._ivy_array = value._ivy_array\n\n    def assign_add(self, delta, use_locking=None, name=None, read_value=True):\n        ivy.utils.assertions.check_equal(\n            delta.shape if hasattr(delta, \"ivy_array\") else ivy.shape(delta),\n            self.shape,\n            as_array=False,\n        )\n        self._ivy_array = tf_frontend.math.add(self._ivy_array, delta._ivy_array)\n\n    def assign_sub(self, delta, use_locking=None, name=None, read_value=True):\n        ivy.utils.assertions.check_equal(\n            delta.shape if hasattr(delta, \"ivy_array\") else ivy.shape(delta),\n            self.shape,\n            as_array=False,\n        )\n        self._ivy_array = tf_frontend.math.subtract(self._ivy_array, delta._ivy_array)\n\n    def batch_scatter_update(\n        self, sparse_delta, use_locking=None, name=None, read_value=True\n    ):\n        pass\n\n    def gather_nd(self, indices, name=None):\n        return tf_frontend.gather_nd(params=self._ivy_array, indices=indices)\n\n    def read_value(self):\n        return tf_frontend.Tensor(self._ivy_array)\n\n    def scatter_add(self, sparse_delta, use_locking=None, name=None, read_value=True):\n        pass\n\n    def scatter_div(self, sparse_delta, use_locking=None, name=None, read_value=True):\n        pass\n\n    def scatter_max(self, sparse_delta, use_locking=None, name=None, read_value=True):\n        pass\n\n    def scatter_min(self, sparse_delta, use_locking=None, name=None, read_value=True):\n        pass\n\n    def scatter_mul(self, sparse_delta, use_locking=None, name=None, read_value=True):\n        pass\n\n    def scatter_nd_add(self, indices, updates, use_locking=None, name=None):\n        pass\n\n    def scatter_nd_sub(self, indices, updates, use_locking=None, name=None):\n        pass\n\n    def scatter_nd_update(self, indices, updates, use_locking=None, name=None):\n        pass\n\n    def scatter_sub(self, sparse_delta, use_locking=None, name=None, read_value=True):\n        pass\n\n    def scatter_update(\n        self, sparse_delta, use_locking=None, name=None, read_value=True\n    ):\n        pass\n\n    def set_shape(self, shape):\n        if shape is None:\n            return\n\n        x_shape = self._ivy_array.shape\n        if len(x_shape) != len(shape):\n            raise ValueError(\n                f\"Tensor's shape {x_shape} is not compatible with supplied shape \"\n                f\"{shape}.\"\n            )\n        for i, v in enumerate(x_shape):\n            if v != shape[i] and (shape[i] is not None):\n                raise ValueError(\n                    f\"Tensor's shape {x_shape} is not compatible with supplied shape \"\n                    f\"{shape}.\"\n                )\n\n    def get_shape(self):\n        return self._ivy_array.shape\n\n    def sparse_read(self, indices, name=None):\n        pass\n\n    def __add__(self, y, name=\"add\"):\n        return self.__radd__(y)\n\n    def __div__(self, x, name=\"div\"):\n        return tf_frontend.math.divide(x, self._ivy_array, name=name)\n\n    def __and__(self, y, name=\"and\"):\n        return y.__rand__(self._ivy_array)\n\n    def __eq__(self, other):\n        return tf_frontend.raw_ops.Equal(\n            x=self._ivy_array, y=other, incompatible_shape_error=False\n        )\n\n    def __floordiv__(self, y, name=\"floordiv\"):\n        return y.__rfloordiv__(self._ivy_array)\n\n    def __ge__(self, y, name=\"ge\"):\n        return tf_frontend.raw_ops.GreaterEqual(\n            x=self._ivy_array, y=y._ivy_array, name=name\n        )\n\n    def __getitem__(self, slice_spec, var=None, name=\"getitem\"):\n        ret = ivy.get_item(self._ivy_array, slice_spec)\n        return Variable(ivy.array(ret, dtype=ivy.dtype(ret), copy=False))\n\n    def __gt__(self, y, name=\"gt\"):\n        return tf_frontend.raw_ops.Greater(x=self._ivy_array, y=y._ivy_array, name=name)\n\n    def __invert__(self, name=\"invert\"):\n        return tf_frontend.raw_ops.Invert(x=self._ivy_array, name=name)\n\n    def __le__(self, y, name=\"le\"):\n        return tf_frontend.raw_ops.LessEqual(\n            x=self._ivy_array, y=y._ivy_array, name=name\n        )\n\n    def __lt__(self, y, name=\"lt\"):\n        return tf_frontend.raw_ops.Less(x=self._ivy_array, y=y._ivy_array, name=name)\n\n    def __matmul__(self, y, name=\"matmul\"):\n        return y.__rmatmul__(self._ivy_array)\n\n    def __mul__(self, x, name=\"mul\"):\n        return tf_frontend.math.multiply(x, self._ivy_array, name=name)\n\n    def __mod__(self, x, name=\"mod\"):\n        return tf_frontend.math.mod(x, self._ivy_array, name=name)\n\n    def __ne__(self, other):\n        return tf_frontend.raw_ops.NotEqual(\n            x=self._ivy_array, y=other._ivy_array, incompatible_shape_error=False\n        )\n\n    def __neg__(self, name=\"neg\"):\n        return tf_frontend.raw_ops.Neg(x=self._ivy_array, name=name)\n\n    def __or__(self, y, name=\"or\"):\n        return y.__ror__(self._ivy_array)\n\n    def __pow__(self, y, name=\"pow\"):\n        return tf_frontend.math.pow(x=self, y=y, name=name)\n\n    def __radd__(self, x, name=\"radd\"):\n        return tf_frontend.math.add(x, self._ivy_array, name=name)\n\n    def __rand__(self, x, name=\"rand\"):\n        return tf_frontend.math.logical_and(x, self._ivy_array, name=name)\n\n    def __rfloordiv__(self, x, name=\"rfloordiv\"):\n        return tf_frontend.raw_ops.FloorDiv(x=x, y=self._ivy_array, name=name)\n\n    def __rmatmul__(self, x, name=\"rmatmul\"):\n        return tf_frontend.raw_ops.MatMul(a=x, b=self._ivy_array, name=name)\n\n    def __rmul__(self, x, name=\"rmul\"):\n        return tf_frontend.raw_ops.Mul(x=x, y=self._ivy_array, name=name)\n\n    def __ror__(self, x, name=\"ror\"):\n        return tf_frontend.raw_ops.LogicalOr(x=x, y=self._ivy_array, name=name)\n\n    def __rpow__(self, x, name=\"rpow\"):\n        return tf_frontend.raw_ops.Pow(x=x, y=self._ivy_array, name=name)\n\n    def __rsub__(self, x, name=\"rsub\"):\n        return tf_frontend.math.subtract(x, self._ivy_array, name=name)\n\n    def __rtruediv__(self, x, name=\"rtruediv\"):\n        return tf_frontend.math.truediv(x, self._ivy_array, name=name)\n\n    def __rxor__(self, x, name=\"rxor\"):\n        return tf_frontend.math.logical_xor(x, self._ivy_array, name=name)\n\n    def __sub__(self, y, name=\"sub\"):\n        return y.__rsub__(self._ivy_array)\n\n    def __truediv__(self, y, name=\"truediv\"):\n        dtype = ivy.dtype(self._ivy_array)\n        if dtype in [ivy.uint8, ivy.int8, ivy.uint16, ivy.int16]:\n            return ivy.astype(y, ivy.float32).__rtruediv__(\n                ivy.astype(self._ivy_array, ivy.float32)\n            )\n        if dtype in [ivy.uint32, ivy.int32, ivy.uint64, ivy.int64]:\n            return ivy.astype(y, ivy.float64).__rtruediv__(\n                ivy.astype(self._ivy_array, ivy.float64)\n            )\n        return y.__rtruediv__(self._ivy_array)\n\n    def __xor__(self, y, name=\"xor\"):\n        return y.__rxor__(self._ivy_array)\n\n    def __setitem__(self, key, value):\n        raise ivy.utils.exceptions.IvyException(\n            \"ivy.functional.frontends.tensorflow.Variable object \"\n            \"doesn't support assignment\"\n        )\n\n\nclass IndexedSlices:\n    def __init__(self, values, indices, dense_shape=None):\n        self._values = values\n        self._indices = indices\n        self._dense_shape = dense_shape\n\n    @property\n    def values(self):\n        \"\"\"A `Tensor` containing the values of the slices.\"\"\"\n        return self._values\n\n    @property\n    def indices(self):\n        \"\"\"A 1-D `Tensor` containing the indices of the slices.\"\"\"\n        return self._indices\n\n    @property\n    def dense_shape(self):\n        \"\"\"A 1-D `Tensor` containing the shape of the corresponding dense\n        tensor.\"\"\"\n        return self._dense_shape\n\n    @property\n    def device(self):\n        \"\"\"The name of the device on which `values` will be produced, or\n        `None`.\"\"\"\n        return self.values.device\n\n    @property\n    def dtype(self):\n        \"\"\"The `DType` of elements in this tensor.\"\"\"\n        return self.values.dtype\n\n    def __repr__(self):\n        return \"IndexedSlices(\\nindices=%s,\\nvalues=%s%s\\n)\" % (\n            self._indices,\n            self._values,\n            (\n                f\", dense_shape={self._dense_shape}\"\n                if self._dense_shape is not None\n                else \"\"\n            ),\n        )\n\n    def __neg__(self):\n        return IndexedSlices(-self._values, self._indices, self._dense_shape)\n", "path": "ivy/functional/frontends/tensorflow/variable.py"}]}