File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change 11import . tensorboard_plugin_hparams. hparams: var"#DataType" as HParamDataType, DatasetType as HDatasetType
22import . tensorboard_plugin_hparams. google. protobuf: ListValue as HListValue, Value as HValue
33import . tensorboard_plugin_hparams. hparams as HP
4+ import ProtoBuf as PB
45
56struct HParamRealDomain
67 min_value:: Float64
@@ -79,6 +80,19 @@ function encode_bytes(content::HP.HParamsPluginData)
7980 return take! (data)
8081end
8182
83+ # Overload the dictionary encoder
84+ function PB. encode (e:: ProtoEncoder , i:: Int , x:: Dict{String,HValue} )
85+ PB. Codecs. encode_tag (e, i, PB. Codecs. LENGTH_DELIMITED)
86+ PB. Codecs. vbyte_encode (e. io, UInt32 (PB. Codecs. _encoded_size (x)))
87+
88+ for (k, v) in x
89+ PB. Codecs. encode (e, 1 , k)
90+ PB. Codecs. encode (e, 2 , v)
91+ end
92+ return nothing
93+ end
94+
95+
8296"""
8397 write_hparams!(logger::TBLogger, hparams::Dict{String, Any}, metrics::AbstractArray{String})
8498
You can’t perform that action at this time.
0 commit comments