Skip to content

Commit 58ba28c

Browse files
committed
Convert reals to floats to comply with hparams plugin
1 parent 532fa36 commit 58ba28c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/hparams.jl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,12 @@ function write_hparams!(logger::TBLogger, hparams::Dict{String, Any}, metrics::A
9999
SESSION_END_INFO_TAG = "_hparams_/session_end_info"
100100

101101
# Check for datatypes
102-
for v in values(hparams)
102+
for (k,v) in hparams
103103
@assert typeof(v) <: Union{Bool, String, Real} "Hyperparameters must be of types String, Bool or Real"
104+
# Cast to other values
105+
if !(typeof(v) <: Bool) && typeof(v) <: Real
106+
hparams[k] = Float64(v)
107+
end
104108
end
105109

106110
hparam_infos = [hparam_info(HParamConfig(; name=k, datatype=typeof(v))) for (k, v) in hparams]

0 commit comments

Comments
 (0)