Skip to content

Commit 4f44f06

Browse files
Update compiler.py 75d2e98
Co-authored-by: ivy-dev-bot <[email protected]>
1 parent 46f4839 commit 4f44f06

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

ivy/compiler/compiler.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ def source_to_source(
2121
source: str = "torch",
2222
target: str = "tensorflow",
2323
reuse_existing: bool = True,
24+
output_dir: str = "ivy_transpiled_outputs/",
2425
):
2526
"""Converts a given object (class/function) from one framework to another.
2627
@@ -39,6 +40,8 @@ def source_to_source(
3940
If False, it will re-translate `object`,
4041
even if it already exists in the directory, and overwrite
4142
the old implementation. Defaults to 'True'.
43+
output_dir (str, optional): The path to the directory where translated files will be saved.
44+
Defaults to 'ivy_transpiled_outputs/' in the current working directory.
4245
4346
Returns:
4447
The translated object."""
@@ -50,6 +53,7 @@ def source_to_source(
5053
source=source,
5154
target=target,
5255
reuse_existing=reuse_existing,
56+
output_dir=output_dir,
5357
)
5458

5559

@@ -174,6 +178,7 @@ def transpile(
174178
source: str = "torch",
175179
target: str = "tensorflow",
176180
reuse_existing: bool = True,
181+
output_dir: str = "ivy_transpiled_outputs/",
177182
):
178183
"""Converts a given object (class/function) from one framework to another.
179184
@@ -192,6 +197,8 @@ def transpile(
192197
If False, it will re-translate `object`,
193198
even if it already exists in the directory, and overwrite
194199
the old implementation. Defaults to 'True'.
200+
output_dir (str, optional): The path to the directory where translated files will be saved.
201+
Defaults to 'ivy_transpiled_outputs/' in the current working directory.
195202
196203
Returns:
197204
The translated object."""
@@ -203,4 +210,5 @@ def transpile(
203210
source=source,
204211
target=target,
205212
reuse_existing=reuse_existing,
213+
output_dir=output_dir,
206214
)

0 commit comments

Comments
 (0)