Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Infer Type issue when dtype passed is None #16816

Open
anirudh2290 opened this issue Nov 14, 2019 · 2 comments
Open

Infer Type issue when dtype passed is None #16816

anirudh2290 opened this issue Nov 14, 2019 · 2 comments
Labels

Comments

@anirudh2290
Copy link
Member

anirudh2290 commented Nov 14, 2019

Description

 data = mx.sym.var("data")
 data2 = mx.sym.var("data2")
 out = mx.sym.elemwise_add(data, data2)
 arg_types, out_types, aux_types = out.infer_type_partial(data=None, data2=np.float32)

This will fail, because of this line : https://github.com/apache/incubator-mxnet/blob/master/python/mxnet/symbol/symbol.py#L1006

Makes it inconsistent to the documentation which says :

Unknown type can be marked as None.

https://github.com/apache/incubator-mxnet/blob/master/python/mxnet/symbol/symbol.py#L896

Also, there is no way to pass unknown types to infer_type_partial because of this bug.

This is because:

>>> np.dtype(None)
dtype('float64')

https://github.com/apache/incubator-mxnet/blob/master/python/mxnet/symbol/symbol.py#L1006

The fix should be simple, but this issue has always been there assuming that np.dype(None) to be converted to float64 was always the case. Will there be users depending on this buggy behavior and are we okay with breaking these user scripts ?

@ptrendx

@samskalicky
Copy link
Contributor

@lanking520 assign @anirudh2290

@anirudh2290
Copy link
Member Author

un-assigning myself since i am not working on this currently. if someone is interested, please go ahead.

@anirudh2290 anirudh2290 removed their assignment May 1, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants