Skip to content

Commit

Permalink
Update compiler.py bb289c4
Browse files Browse the repository at this point in the history
Co-authored-by: ivy-dev-bot <[email protected]>
  • Loading branch information
Sam-Armstrong and ivy-dev-bot authored Aug 2, 2024
1 parent 3d3c4bc commit 394541b
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 16 deletions.
4 changes: 3 additions & 1 deletion binaries.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,9 @@
"MX",
"V",
"VC",
"VCC",
"VCI",
"VCL",
"VCV",
"VCX",
"VD",
Expand Down Expand Up @@ -143,4 +145,4 @@
}
]
}
}
}
31 changes: 16 additions & 15 deletions ivy/compiler/compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,18 @@


def clear_graph_cache():
"""Clears the graph cache which gets populated if `graph_caching` is set to
`True` in `ivy.trace_graph`, `ivy.transpile` or `ivy.unify`.
"""Clears the graph cache which gets populated if `graph_caching` is set
to `True` in `ivy.trace_graph`, `ivy.transpile` or `ivy.unify`. Use this to
reset or clear the graph cache if needed.
Examples
--------
>>> import ivy
>>> ivy.clear_graph_cache()"""

Use this to reset or clear the graph cache if needed.
"""
from ._compiler import clear_graph_cache as _clear_graph_cache

_clear_graph_cache()
return _clear_graph_cache()


def source_to_source(
Expand All @@ -27,16 +31,14 @@ def source_to_source(
as well e.g. (source="torch_frontend", target="ivy") or (source="torch_frontend", target="tensorflow") etc.
Args:
----
object: The object (class/function) to be translated.
source (str, optional): The source framework. Defaults to 'torch'.
target (str, optional): The target framework. Defaults to 'torch_frontend'.
profiling: Whether to add performance profiling.
Returns:
-------
The translated object.
"""
The translated object."""

from ._compiler import source_to_source as _source_to_source

return _source_to_source(
Expand Down Expand Up @@ -67,8 +69,7 @@ def trace_graph(
params_v=None,
v=None
):
"""Takes `fn` and traces it into a more efficient composition of backend
operations.
"""Takes `fn` and traces it into a more efficient composition of backend operations.
Parameters
----------
Expand Down Expand Up @@ -138,8 +139,8 @@ def trace_graph(
>>> start = time.time()
>>> graph(x)
>>> print(time.time() - start)
0.0001785755157470703
"""
0.0001785755157470703"""

from ._compiler import trace_graph as _trace_graph

return _trace_graph(
Expand Down Expand Up @@ -203,8 +204,8 @@ def transpile(
Returns
-------
Either a transpiled Graph or a non-initialized LazyGraph.
"""
Either a transpiled Graph or a non-initialized LazyGraph."""

from ._compiler import transpile as _transpile

return _transpile(
Expand Down

0 comments on commit 394541b

Please sign in to comment.