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

Wrong results of min([inf, inf]) and max([-inf,-inf]) #16206

Closed
wkcn opened this issue Sep 19, 2019 · 2 comments
Closed

Wrong results of min([inf, inf]) and max([-inf,-inf]) #16206

wkcn opened this issue Sep 19, 2019 · 2 comments
Labels
Backend Issues related to the backend of MXNet Bug Operator

Comments

@wkcn
Copy link
Member

wkcn commented Sep 19, 2019

Description

Hi, there. The user Orb! found the bug.
The results of min([inf, inf]) and max([-inf,-inf]) are wrong.

Environment info (Required)

----------Python Info----------
Version      : 3.7.4
Compiler     : GCC 9.1.0
Build        : ('default', 'Jul 16 2019 07:12:58')
Arch         : ('64bit', 'ELF')
------------Pip Info-----------
Version      : 19.0.3
Directory    : /usr/lib/python3.7/site-packages/pip
----------MXNet Info-----------
Version      : 1.6.0
Directory    : /home/wkcn/proj/mxnet/python/mxnet
Commit hash file "/home/wkcn/proj/mxnet/python/mxnet/COMMIT_HASH" not found. Not installed from pre-built package or built from source.
Library      : ['/home/wkcn/proj/mxnet/python/mxnet/../../lib/libmxnet.so']

Package used (Python/R/Scala/Julia):
Python

Build info (Required if built from source)

Compiler (gcc/clang/mingw/visual studio): gcc

MXNet commit hash:
5f9a680

Build config:
make -j4 USE_OPENCV=1 USE_CPP_PACKAGE=1

Minimum reproducible example

import mxnet as mx
import numpy as np

a = mx.nd.array([np.inf, np.inf])
print(a)
print(mx.nd.min(a), mx.nd.max(a))

print('======')

a = -a
print(a)
print(mx.nd.min(a), mx.nd.max(a))

It shows the output as follow:

[inf inf]
<NDArray 2 @cpu(0)>

[3.4028235e+38]
<NDArray 1 @cpu(0)>
[inf]
<NDArray 1 @cpu(0)>
======

[-inf -inf]
<NDArray 2 @cpu(0)>

[-inf]
<NDArray 1 @cpu(0)>
[-3.4028235e+38]
<NDArray 1 @cpu(0)>
@mxnet-label-bot
Copy link
Contributor

Hey, this is the MXNet Label Bot.
Thank you for submitting the issue! I will try and suggest some labels so that the appropriate MXNet community members can help resolve it.
Here are my recommended label(s): Bug

@wkcn
Copy link
Member Author

wkcn commented Sep 20, 2019

Close it since the issue has been addressed in PR #16226

@wkcn wkcn closed this as completed Sep 20, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Backend Issues related to the backend of MXNet Bug Operator
Projects
None yet
Development

No branches or pull requests

3 participants