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

Fixed broadcast_optimizer_state to properly convert nested types #608

Merged
merged 1 commit into from Nov 3, 2018

Conversation

Projects
None yet
2 participants
@tgaddair
Collaborator

tgaddair commented Nov 2, 2018

Fixes #605

@tgaddair tgaddair requested a review from alsrgv Nov 2, 2018

if isinstance(dtype, tuple):
t, dtypes = dtype
x = t(x)
return t([_recursive_cast(x[i], dtypes[i]) for i in range(len(x))])

This comment has been minimized.

@alsrgv

alsrgv Nov 2, 2018

Collaborator

Does this work with both lists, set, and dictionaries?

This comment has been minimized.

@tgaddair

tgaddair Nov 2, 2018

Collaborator

It will work with lists, sets, and tuples. However, it will not work with dictionaries as is, but I can make that change.

This comment has been minimized.

@alsrgv

alsrgv Nov 2, 2018

Collaborator

Let's do it - maybe there will be dictionaries, too.

This comment has been minimized.

@tgaddair

tgaddair Nov 2, 2018

Collaborator

The one catch here is that dictionaries cannot be converted to tensors using torch.Tensor. So in order to support dictionaries, we'd need to make changes to our encoding as well as our decoding.

This comment has been minimized.

@alsrgv

alsrgv Nov 2, 2018

Collaborator

Oh, I see. I guess we could wait until this becomes necessary then.

This comment has been minimized.

@tgaddair

tgaddair Nov 2, 2018

Collaborator

Sounds good.

@alsrgv

alsrgv approved these changes Nov 2, 2018

LGTM

@tgaddair tgaddair merged commit 62d2869 into master Nov 3, 2018

3 checks passed

License Compliance All checks passed.
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
license/cla Contributor License Agreement is signed.
Details

@tgaddair tgaddair deleted the broadcast_fix branch Nov 3, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment