Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initialising constant with list sets size to None #9

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

samgd
Copy link

@samgd samgd commented Jul 12, 2018

constant is a NodeDef(type=Constant, params=Signature(value, size=None)).

The notebook calls this with a list of [torch.Tensor, tuple] as follows:

state = {n: (constant([v.data, tuple(v.size())]), []) for n, v in state_dict.items()}

The NodeDef __call__ implementation binds this list to the params value leaving size to be set to None by the call to apply_defaults.

Removing the list causes the tensor to be correctly bound to value and tuple to be bound to size as expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant