Fix _apply in nn.Module (#15305)
authorPeter Goldsborough <psag@fb.com>
Tue, 18 Dec 2018 00:08:05 +0000 (16:08 -0800)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Tue, 18 Dec 2018 00:22:21 +0000 (16:22 -0800)
commitaec9fdf0a41fc304e1bd5424b9baf83101834083
tree4b464c1035e03849bb84083761329ac759e130bb
parent2f38ffbcb300fa75bd97ec70a446540bcba4ee7c
Fix _apply in nn.Module (#15305)

Summary:
Fixes an issue that arose from https://github.com/pytorch/pytorch/pull/13481 where `.shared_memory()` couldn't be called. Effectively undoes all changes to `nn.Module` from that PR and solve the relevant problem in a different way (the goal was to be able to call `._apply()` on the Python wrapper for a C++ module).

soumith
Pull Request resolved: https://github.com/pytorch/pytorch/pull/15305

Differential Revision: D13493937

Pulled By: goldsborough

fbshipit-source-id: 4cb8687f90fc8709a536c5e7eacd0dc8edf6f750
test/test_cpp_extensions.py
test/test_nn.py
torch/nn/cpp.py
torch/nn/modules/module.py