class_docstr: The result of a Timer measurement.
  
  This class stores one or more measurements of a given statement. It is
  serializable and provides several convenience methods
  (including a detailed __repr__) for downstream consumers.
docstr: Convenience method for merging replicates.
  
  Merge will extrapolate times to `number_per_run=1` and will not
  transfer any metadata. (Since it might differ between replicates)
docstr_tok: ["Convenience","method","for","merging","replicates",".","Merge","will","extrapolate","times","to","`","number_per_run=1","`","and","will","not","transfer","any","metadata",".","(","Since","it","might","differ","between","replicates",")"]
code: def merge(
      measurements: Iterable["Measurement"],
  ) -> List["Measurement"]:
      """Convenience method for merging replicates.
  
      Merge will extrapolate times to `number_per_run=1` and will not
      transfer any metadata. (Since it might differ between replicates)
      """
      grouped_measurements: DefaultDict[
          TaskSpec, List[Measurement]
      ] = collections.defaultdict(list)
      for m in measurements:
          grouped_measurements[m.task_spec].append(m)
  
      def merge_group(
          task_spec: TaskSpec, group: List["Measurement"]
      ) -> "Measurement":
          times: List[float] = []
          for m in group:
              # Different measurements could have different `number_per_run`,
              # so we call `.times` which normalizes the results.
              times.extend(m.times)
  
          return Measurement(
              number_per_run=1,
              raw_times=times,
              task_spec=task_spec,
              metadata=None,
          )
  
      return [
          merge_group(t, g) for t, g in grouped_measurements.items()
      ]
  
imports: import collections
  import contextlib
  import dataclasses
  import os
  import shutil
  import tempfile
  import textwrap
  import time
  from typing import cast, Any, DefaultDict, Dict, Iterable, Iterator, List, Optional, Tuple
  import uuid
  import torch
label_desc: Use image node_id 15 for calling the Measurement obj's underlying member method code with example usage: obj.merge(measurements) and returns: unknown, Measurement