KEMBAR78
[jit] Add some of nn.init to weak script by driazati · Pull Request #19640 · pytorch/pytorch · GitHub
Skip to content

Conversation

@driazati
Copy link
Contributor

@driazati driazati commented Apr 23, 2019

Stack from ghstack:

Differential Revision: D15065332

@pytorchbot pytorchbot added oncall: jit Add this issue/PR to JIT oncall triage queue module: nn Related to torch.nn labels Apr 23, 2019
[jit] Add some of nn.init to weak script

gh-metadata: pytorch pytorch 19640 gh/driazati/26/head
[jit] Add some of nn.init to weak script

gh-metadata: pytorch pytorch 19640 gh/driazati/26/head
@driazati driazati force-pushed the gh/driazati/26/head branch from b606124 to ebc8c39 Compare April 24, 2019 16:53
@driazati driazati requested a review from eellison April 24, 2019 21:16
Copy link
Contributor

@eellison eellison left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. A little more coverage on different inputs would be nice, as would be adding the div float / int, which should be a really really easy change.


def test_nn_init(self):
tests = (
('constant_', (lambda: (torch.ones(2, 2), 2.5)), "Tensor, float"),
Copy link
Contributor

@eellison eellison Apr 24, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you switch it to rand ? plz do so before landing

@zou3519 zou3519 deleted the gh/driazati/26/head branch April 25, 2019 00:02
"""
with torch.no_grad():
return tensor.fill_(1)
return _no_grad_fill_(tensor, 1.)
Copy link
Contributor

@eellison eellison Apr 25, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm it looks like this is changing the semantics, because previously the type of the tensor would have been preserved, but now it is being filled with floats. ALthought not 100% sure

@facebook-github-bot
Copy link
Contributor

@driazati merged this pull request in c08f3d0.

zhangguanheng66 pushed a commit to zhangguanheng66/pytorch that referenced this pull request May 6, 2019
Summary:
Stack from [ghstack](https://github.com/ezyang/ghstack):
* **pytorch#19640 [jit] Add some of nn.init to weak script**

Pull Request resolved: pytorch#19640

Pulled By: driazati

Differential Revision: D15065332

fbshipit-source-id: 30df9f02e527cd5e5ebe34b7e003444eae96c66d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

module: nn Related to torch.nn oncall: jit Add this issue/PR to JIT oncall triage queue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants