"...git@developer.sourcefind.cn:renzhc/diffusers_dcu.git" did not exist on "9b5180cb5f00799ec47b778533db9dcbf83ceda4"
Unverified Commit 6ab593ec authored by Da Zheng's avatar Da Zheng Committed by GitHub
Browse files

throw an error when using with mxnet < 1.5. (#767)

parent 1c9c0339
...@@ -12,10 +12,12 @@ from ... import kernel as K ...@@ -12,10 +12,12 @@ from ... import kernel as K
from ...function.base import TargetCode from ...function.base import TargetCode
MX_VERSION = LooseVersion(mx.__version__) 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 MXNet 1.5, empty tensors aren't supprted by default.
# after we turn on the numpy compatible flag, MXNet supports empty NDArray. # 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)
mx.set_np_shape(True)
def data_type_dict(): def data_type_dict():
return {'float16' : np.float16, return {'float16' : np.float16,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment