Skip to content

Commit

Permalink
Assume reportable metric to be a scalar
Browse files Browse the repository at this point in the history
Signed-off-by: Shah, Karan <[email protected]>
  • Loading branch information
MasterSkepticista committed Dec 21, 2024
1 parent c4eb30b commit 9b3da0e
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions openfl/component/collaborator/collaborator.py
Original file line number Diff line number Diff line change
Expand Up @@ -500,12 +500,7 @@ def send_task_results(self, tensor_dict, round_number, task_name) -> dict:
tensor_name, origin, fl_round, report, tags = tensor

if report:
# This tensor must be a scalar metric
assert (
tensor_dict[tensor].ndim == 0
), "Expected `report` tensor to be a scalar, instead got one with shape {}".format(
tensor_dict[tensor].shape
)
# Reportable metric must be a scalar
value = float(tensor_dict[tensor])
metrics.update({f"{self.collaborator_name}/{task_name}/{tensor_name}": value})

Expand Down

0 comments on commit 9b3da0e

Please sign in to comment.