94
94
Returns the type of a summary
95
95
"""
96
96
function summary_type (summary)
97
- if isdefined (summary, :histo )
97
+ if hasproperty (summary, :histo )
98
98
return :histo
99
- elseif isdefined (summary, :image )
99
+ elseif hasproperty (summary, :image )
100
100
return :image
101
- elseif isdefined (summary, :audio )
101
+ elseif hasproperty (summary, :audio )
102
102
return :audio
103
- elseif isdefined (summary, :tensor )
103
+ elseif hasproperty (summary, :tensor )
104
104
return :tensor
105
- # elseif isdefined (summary, :simple_value)
105
+ # elseif hasproperty (summary, :simple_value)
106
106
end
107
107
# always defined
108
108
return :simple_value
@@ -212,7 +212,7 @@ function map_summaries(fun::Function, logdir; purge=true, tags=nothing, steps=no
212
212
for event in event_file
213
213
# if event.summary is not defined, don't bother processing this event,
214
214
# as it's probably a "start file" event or a graph event.
215
- ! isdefined (event, :summary ) && continue
215
+ ! hasproperty (event, :summary ) && continue
216
216
217
217
step = event. step
218
218
steps != = nothing && step ∉ steps && continue
@@ -239,7 +239,7 @@ When the keyword argument `purge==true`, if the i+1-th file begins with a purge
239
239
at step `s`, the i-th file is read only up to step `s`.
240
240
241
241
Also metadata events, without any real data attached are mapped.
242
- You can detect those by `isdefined (event, :summary) == false`
242
+ You can detect those by `hasproperty (event, :summary) == false`
243
243
244
244
Optional kwargs `steps` takes as input a collection of integers, and will
245
245
only iterate across events with step within that collection.
0 commit comments