Skip to content
This repository has been archived by the owner on Sep 18, 2024. It is now read-only.

Allow serializing NaN in SDK #1711

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/sdk/pynni/nni/msg_dispatcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def _pack_parameter(parameter_id, params, customized=False, trial_job_id=None, p
ret['parameter_index'] = parameter_index
else:
ret['parameter_index'] = 0
return json_tricks.dumps(ret)
return json_tricks.dumps(ret, allow_nan=True)


class MsgDispatcher(MsgDispatcherBase):
Expand Down
2 changes: 1 addition & 1 deletion src/sdk/pynni/nni/platform/local.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def request_next_parameter():
'type': 'REQUEST_PARAMETER',
'sequence': 0,
'parameter_index': _param_index
})
}, allow_nan=True)
send_metric(metric)

def get_next_parameter():
Expand Down
4 changes: 2 additions & 2 deletions src/sdk/pynni/nni/trial.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def report_intermediate_result(metric):
'type': 'PERIODICAL',
'sequence': _intermediate_seq,
'value': metric
})
}, allow_nan=True)
_intermediate_seq += 1
platform.send_metric(metric)

Expand All @@ -98,5 +98,5 @@ def report_final_result(metric):
'type': 'FINAL',
'sequence': 0,
'value': metric
})
}, allow_nan=True)
platform.send_metric(metric)