Skip to content

Commit

Permalink
fix the type annotation (pytorch#1251)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: pytorch#1251

for https://www.internalfb.com/diff/D51033222?dst_version_fbid=1068426881261755&transaction_fbid=895472858810060

Reviewed By: stephenyan1231

Differential Revision: D51490247

fbshipit-source-id: 585bf4e954a1f802d4ab04b9bf8c35bb3d9bf5cd
  • Loading branch information
cccclai authored and facebook-github-bot committed Nov 21, 2023
1 parent e94f58b commit 19fe8ec
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions exir/backend/partitioner.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from abc import ABC, abstractmethod
from dataclasses import dataclass
from types import MappingProxyType
from typing import Dict, List, NamedTuple, Union
from typing import Dict, List, Mapping, NamedTuple, Union

from executorch.exir.backend.backend_details import enforcedmethod
from executorch.exir.backend.compile_spec_schema import CompileSpec
Expand Down Expand Up @@ -56,17 +56,15 @@ class Partitioner(ABC):

def __init__(
self,
spec: MappingProxyType[Union[str, int, float, bool], object] = MappingProxyType(
{}
),
spec: Mapping[Union[str, int, float, bool], object] = MappingProxyType({}),
):
self._spec = spec

def __call__(self, exported_program: ExportedProgram) -> PartitionResult:
return self.partition(exported_program)

@property
def spec(self) -> MappingProxyType[Union[str, int, float, bool], object]:
def spec(self) -> Mapping[Union[str, int, float, bool], object]:
return self._spec

@enforcedmethod
Expand Down

0 comments on commit 19fe8ec

Please sign in to comment.