Skip to content

Commit

Permalink
feat: add placeholder torch.load and torch.save frontends
Browse files Browse the repository at this point in the history
  • Loading branch information
Sam-Armstrong committed Sep 14, 2024
1 parent 4278aab commit da92c0f
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ivy/functional/frontends/torch/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,8 @@ def promote_types_of_torch_inputs(
from .func import *
from . import casting_ops
from .casting_ops import *
from . import serialization
from .serialization import *

_frontend_array = tensor

Expand Down
1 change: 1 addition & 0 deletions ivy/functional/frontends/torch/serialization/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from .serialization import *
28 changes: 28 additions & 0 deletions ivy/functional/frontends/torch/serialization/serialization.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# global
from typing import Any, Optional

# local
import ivy


def load(
f,
map_location=None,
pickle_module: Any = None,
*,
weights_only: Optional[bool] = None,
mmap: Optional[bool] = None,
**pickle_load_args: Any,
) -> Any:
raise ivy.exceptions.IvyNotImplementedException("The `torch.load` frontend has not yet been implemented.")


def save(
obj: object,
f,
pickle_module: Any = None,
pickle_protocol: int = 2,
_use_new_zipfile_serialization: bool = True,
_disable_byteorder_record: bool = False
) -> None:
raise ivy.exceptions.IvyNotImplementedException("The `torch.save` frontend has not yet been implemented.")

0 comments on commit da92c0f

Please sign in to comment.