Skip to content

Fix TypeError when extending boolean mask arrays with numpy bools - #2869

Open
mayuriphad wants to merge 1 commit into
apple:mainfrom
mayuriphad:fix-numpy-bool-masks
Open

mayuriphad wants to merge 1 commit into
apple:mainfrom
mayuriphad:fix-numpy-bool-masks

Conversation

@mayuriphad

Copy link
Copy Markdown

This PR fixes #793.

Currently, passing numpy arrays of booleans (e.g.
umpy.bool_) into \�dd_slice_dynamic\ or \�dd_slice_static\ as \�egin_masks, \end_masks, or \squeeze_masks\ causes a \TypeError\ during protobuf serialization. Protobuf strictly checks for the native python \�ool\ type and rejects
umpy.bool_.

This patch adds explicit list comprehensions casting the mask elements to python \�ool\ before extending the \spec_layer_params.

This branch has not been deployed

No deployments
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.

PyTorch conversion error - TypeError with bool

1 participant