Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion test/jit/test_freezing.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def forward(self, x):
m.eval()
input = torch.randn(2, 2)
output_s = m.forward(input)
mf = torch._C._freeze_module(m._c)
mf = torch.jit.freeze(m)

# Check if frozen module looks as below:
# module m {
Expand All @@ -127,6 +127,7 @@ def forward(self, x):
# }
# }
# }
mf = mf._c
self.assertFalse(mf.hasattr('sub1'))
self.assertFalse(mf.hasattr('a'))
self.assertTrue(mf.hasattr('b'))
Expand Down
2 changes: 2 additions & 0 deletions torch/jit/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@
from torch.jit._serialization import save, load
from torch.jit._fuser import optimized_execution, fuser, last_executed_optimized_graph

from torch.jit._freeze import freeze

# For backwards compatibility
_fork = fork
_wait = wait
Expand Down