Skip to content

Commit

Permalink
throw an error when using with mxnet < 1.5. (dmlc#767)
Browse files Browse the repository at this point in the history
  • Loading branch information
zheng-da authored Aug 28, 2019
1 parent 1c9c033 commit 6ab593e
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions python/dgl/backend/mxnet/tensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,12 @@
from ...function.base import TargetCode

MX_VERSION = LooseVersion(mx.__version__)
if MX_VERSION.version[0] == 1 and MX_VERSION.version[1] < 5:
raise Exception("DGL has to work with MXNet version >= 1.5")

# After MXNet 1.5, empty tensors aren't supprted by default.
# after we turn on the numpy compatible flag, MXNet supports empty NDArray.
if MX_VERSION.version[0] == 1 and MX_VERSION.version[1] >= 5:
mx.set_np_shape(True)
# After we turn on the numpy compatible flag, MXNet supports empty NDArray.
mx.set_np_shape(True)

def data_type_dict():
return {'float16' : np.float16,
Expand Down

0 comments on commit 6ab593e

Please sign in to comment.