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

Commit

Permalink
Enforces NDArray type in get_symbol (#16871)
Browse files Browse the repository at this point in the history
Signed-off-by: Serge Panev <spanev@nvidia.com>
  • Loading branch information
Kh4L authored and ptrendx committed Nov 20, 2019
1 parent 7c9cb6b commit 95c3d03
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions python/mxnet/autograd.py
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,8 @@ def get_symbol(x):
Symbol
The retrieved Symbol.
"""
assert isinstance(x, NDArray), \
"get_symbol: Invalid argument type, expecting %s, got %s"%(NDArray, type(x))
hdl = SymbolHandle()
check_call(_LIB.MXAutogradGetSymbol(x.handle, ctypes.byref(hdl)))
return Symbol(hdl)
Expand Down

0 comments on commit 95c3d03

Please sign in to comment.