Skip to content

Commit

Permalink
Fix NaN json serialization in Aim GetRunMetrics (#439)
Browse files Browse the repository at this point in the history
  • Loading branch information
jgiannuzzi authored Oct 11, 2023
1 parent 811539f commit 77afd50
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions pkg/api/aim/runs.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,18 +173,19 @@ func GetRunMetrics(c *fiber.Ctx) error {
}

metrics := make(map[string]struct {
values []float64
values []*float64
iters []int
}, len(metricKeys))
for _, m := range r.Metrics {
k := metrics[m.Key]

v := m.Value
pv := &v
if m.IsNan {
v = math.NaN()
pv = nil
}

k.values = append(k.values, v)
k.values = append(k.values, pv)
k.iters = append(k.iters, int(m.Iter))
metrics[m.Key] = k
}
Expand Down

0 comments on commit 77afd50

Please sign in to comment.