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

different dtype when calculating division compared with numpy #18297

@acphile

Description

@acphile

For example:
in mxnet.numpy
   for two ndarray a,b with dtype='int64', the dtype of result c = a / b is 'float32'
in numpy
   the dtype is 'float64'
Generally, when calculating division, mxnet.numpy often uses float32 while numpy uses float64.
Using float32 will often lead to the loss of floating point precision.

b=mx.np.array(1, dtype='int32')
e=b/3
e.item()
>>> 0.3333333432674408

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions