This repository was archived by the owner on Nov 17, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6.8k
InferShape return false not caught in Symbolic mode #12337
Copy link
Copy link
Open
Description
Description
When the inputs to an operator is invalid, the InferShape in the operator returns false. This return value is not caught and treated properly in Symbolic mode, whereas the imperative mode would raise error.
Environment info (Required)
----------Python Info----------
Version : 3.6.5
Compiler : GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.39.2)
Build : ('default', 'Jun 17 2018 12:26:58')
Arch : ('64bit', '')
------------Pip Info-----------
Version : 18.0
Directory : /Users/lnyuan/.virtualenvs/mxnet/lib/python3.6/site-packages/pip
----------MXNet Info-----------
Version : 1.3.0
Directory : /Users/lnyuan/work/incubator-mxnet/python/mxnet
Hashtag not found. Not installed from pre-built package.
----------System Info----------
Platform : Darwin-16.7.0-x86_64-i386-64bit
system : Darwin
node : 88e9fe759c49.ant.amazon.com
release : 16.7.0
version : Darwin Kernel Version 16.7.0: Thu Jun 21 20:07:39 PDT 2018; root:xnu-3789.73.14~1/RELEASE_X86_64
----------Hardware Info----------
machine : x86_64
processor : i386
b'machdep.cpu.extfeatures: SYSCALL XD 1GBPAGE EM64T LAHF LZCNT PREFETCHW RDTSCP TSCI'
b'machdep.cpu.leaf7_features: SMEP ERMS RDWRFSGS TSC_THREAD_OFFSET BMI1 AVX2 BMI2 INVPCID SMAP RDSEED ADX IPT SGX FPU_CSDS MPX CLFSOPT'
b'machdep.cpu.features: FPU VME DE PSE TSC MSR PAE MCE CX8 APIC SEP MTRR PGE MCA CMOV PAT PSE36 CLFSH DS ACPI MMX FXSR SSE SSE2 SS HTT TM PBE SSE3 PCLMULQDQ DTES64 MON DSCPL VMX EST TM2 SSSE3 FMACX16 TPR PDCM SSE4.1 SSE4.2 x2APIC MOVBE POPCNT AES PCID XSAVE OSXSAVE SEGLIM64 TSCTMR AVX1.0 RDRAND F16C'
b'machdep.cpu.brand_string: Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz'
----------Network Test----------
Setting timeout: 10
Timing for MXNet: https://github.com/apache/incubator-mxnet, DNS: 0.0155 sec, LOAD: 0.5818 sec.
Timing for Gluon Tutorial(en): http://gluon.mxnet.io, DNS: 0.0546 sec, LOAD: 0.2440 sec.
Timing for Gluon Tutorial(cn): https://zh.gluon.ai, DNS: 0.0239 sec, LOAD: 0.2014 sec.
Timing for FashionMNIST: https://apache-mxnet.s3-accelerate.dualstack.amazonaws.com/gluon/dataset/fashion-mnist/train-labels-idx1-ubyte.gz, DNS: 0.0233 sec, LOAD: 0.1084 sec.
Timing for PYPI: https://pypi.python.org/pypi/pip, DNS: 0.0113 sec, LOAD: 0.4376 sec.
Timing for Conda: https://repo.continuum.io/pkgs/free/, DNS: 0.0187 sec, LOAD: 0.0672 sec.
Package used (Python/R/Scala/Julia):
Python
Minimum reproducible example
import mxnet as mx
cond = mx.sym.Variable('cond')
x = mx.sym.Variable('x')
y = mx.sym.Variable('y')
out = mx.sym.where(cond, x, y)
test = lambda c: out.eval(x=mx.nd.array([[2,3],[4,5],[6,7]]),
y=mx.nd.array([[8,9],[10,11],[12,13]]),
cond=mx.nd.array(c))
## invalid input but no error is raised
print(test([[1, 0, 1],[1,1,0]]))
test = lambda c: mx.nd.where(x=mx.nd.array([[2,3],[4,5],[6,7]]),
y=mx.nd.array([[8,9],[10,11],[12,13]]),
cond=mx.nd.array(c))
# error raised in imperative mode
print(test([[1, 0, 1],[1,1,0]]))