@@ -133,6 +133,11 @@ def __init__(self, output_filename: Optional[str] = None, extended=True):
133
133
Args:
134
134
output_filename: optionally save profile results to file instead of printing
135
135
to std out when training is finished.
136
+
137
+ Raises:
138
+ ValueError:
139
+ If you attempt to start an action which has already started, or
140
+ if you attempt to stop recording an action which was never started.
136
141
"""
137
142
self .current_actions = {}
138
143
self .recorded_durations = defaultdict (list )
@@ -234,6 +239,10 @@ def __init__(self, output_filename: Optional[str] = None, line_count_restriction
234
239
line_count_restriction: this can be used to limit the number of functions
235
240
reported for each action. either an integer (to select a count of lines),
236
241
or a decimal fraction between 0.0 and 1.0 inclusive (to select a percentage of lines)
242
+
243
+ Raises:
244
+ ValueError:
245
+ If you attempt to stop recording an action which was never started.
237
246
"""
238
247
self .profiled_actions = {}
239
248
self .line_count_restriction = line_count_restriction
@@ -376,6 +385,13 @@ def __init__(
376
385
377
386
local_rank: When running in distributed setting, local_rank is used for each process
378
387
to write to their own file if `output_fname` is provided.
388
+
389
+ Raises:
390
+ MisconfigurationException:
391
+ If arg ``sort_by_key`` is not present in ``AVAILABLE_SORT_KEYS``, or
392
+ if log file is not a ``.txt`` file.
393
+ ValueError:
394
+ If you attempt to stop recording an action which was never started.
379
395
"""
380
396
381
397
self .profiled_actions = {}
0 commit comments