Skip to content

Commit

Permalink
[export] Remove CallSpec (pytorch#117671)
Browse files Browse the repository at this point in the history
Summary:

X-link: pytorch/executorch#1618

This is not really being used anywhere

Test Plan: CI

Reviewed By: zhxchen17

Differential Revision: D52842563
  • Loading branch information
angelayi authored and facebook-github-bot committed Jan 22, 2024
1 parent 01abb5a commit 78cbac1
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 14 deletions.
3 changes: 0 additions & 3 deletions torch/_export/__init__.py
Expand Up @@ -73,9 +73,6 @@
from torch.fx.graph import _PyTreeCodeGen, _PyTreeInfo
from torch.utils._sympy.value_ranges import ValueRangeError, ValueRanges

from .exported_program import (
CallSpec,
)
from .passes.add_runtime_assertions_for_constraints_pass import (
_AddRuntimeAssertionsForInlineConstraintsPass,
)
Expand Down
10 changes: 0 additions & 10 deletions torch/_export/exported_program.py
@@ -1,11 +1,8 @@
import dataclasses
from typing import Optional
import warnings


import torch
import torch.fx
import torch.utils._pytree as pytree


# TODO(ycao): This is added to avoid breaking existing code temporarily.
Expand All @@ -32,13 +29,6 @@
]


# Information to maintain user calling/returning specs
@dataclasses.dataclass
class CallSpec:
in_spec: Optional[pytree.TreeSpec]
out_spec: Optional[pytree.TreeSpec]


def _create_graph_module_for_export(root, graph):
try:
gm = torch.fx.GraphModule(root, graph)
Expand Down
3 changes: 2 additions & 1 deletion torch/export/exported_program.py
@@ -1,4 +1,5 @@
import copy
from collections import namedtuple
import dataclasses
import functools
import types
Expand Down Expand Up @@ -213,7 +214,7 @@ def example_inputs(self):
@property
@compatibility(is_backward_compatible=False)
def call_spec(self):
from torch._export.exported_program import CallSpec
CallSpec = namedtuple("CallSpec", ["in_spec", "out_spec"])

if len(self.module_call_graph) == 0:
return CallSpec(in_spec=None, out_spec=None)
Expand Down

0 comments on commit 78cbac1

Please sign in to comment.