Skip to content

Commit

Permalink
fix some error
Browse files Browse the repository at this point in the history
  • Loading branch information
liukai committed Aug 10, 2022
1 parent 8f13648 commit 7004e56
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion mmrazor/structures/graph/base_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def copy_from(cls,

# connect
for old in graph:
for pre in old.pre:
for pre in old.prev_nodes:
new_graph.connect(old2new[pre], old2new[old])
return new_graph

Expand Down
6 changes: 5 additions & 1 deletion mmrazor/structures/graph/module_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def __init__(self,
>>> class Pool(nn.Module):
def forward(x):
return F.adaptive_avg_pool2d(x,2).flatten(1)
>>> node= ModuleNode('pass_0',Pool(),expadn_ratio=4)
>>> node= ModuleNode('pass_0',Pool(),expand_ratio=4)
>>> assert node.out_channels == node.in_channels*4
"""

Expand Down Expand Up @@ -207,6 +207,10 @@ def check_type(self):
class ModuleGraph(BaseGraph[MODULENODE]):
"""Computatation Graph."""

def __init__(self) -> None:
super().__init__()
self._model = None

# functions to generate module graph.

@staticmethod
Expand Down

0 comments on commit 7004e56

Please sign in to comment.