Skip to content

Commit

Permalink
fix: 424 allow any np.intX as training target
Browse files Browse the repository at this point in the history
  • Loading branch information
Optimox committed Apr 24, 2023
1 parent fc59ea6 commit 63a8dba
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pytorch_tabnet/utils.py
Expand Up @@ -422,8 +422,8 @@ def define_device(device_name):

class ComplexEncoder(json.JSONEncoder):
def default(self, obj):
if isinstance(obj, np.int64):
return int(obj)
if isinstance(obj, (np.generic, np.ndarray)):
return obj.tolist()
# Let the base class default method raise the TypeError
return json.JSONEncoder.default(self, obj)

Expand Down

0 comments on commit 63a8dba

Please sign in to comment.