class_docstr: A ``SearcherOperation`` is a request from the hyperparameter-search logic for the training
  script to execute one train-validate-report cycle.
  
  Some searchers, such as single, random, or grid, pass only a single ``SearcherOperation`` to
  each trial, while others may pass many ``SearcherOperations``.
  
  Each ``SearcherOperation`` has a length attribute representing the cumulative training that
  should be completed before the validate-report steps of the cycle.  The length attribute is
  absolute, not incremental, meaning that if the searcher wants you to train for 10 units and
  validate, then train for 10 more units and validate, it emits one ``SearcherOperation`` with
  ``.length=10`` followed by a second ``SearcherOperation`` with ``.length=20``.  Using absolute
  lengths instead of incremental lengths makes restarting after crashes simple and robust.
class_docstr_tok: ["A","``","SearcherOperation","``","is","a","request","from","the","hyperparameter-search","logic","for","the","training","script","to","execute","one","train-validate-report","cycle",".","Some","searchers",",","such","as","single",",","random",",","or","grid",",","pass","only","a","single","``","SearcherOperation","``","to","each","trial",",","while","others","may","pass","many","``","SearcherOperations","``",".","Each","``","SearcherOperation","``","has","a","length","attribute","representing","the","cumulative","training","that","should","be","completed","before","the","validate-report","steps","of","the","cycle",".","The","length","attribute","is","absolute",",","not","incremental",",","meaning","that","if","the","searcher","wants","you","to","train","for","10","units","and","validate",",","then","train","for","10","more","units","and","validate",",","it","emits","one","``","SearcherOperation","``","with","``",".length=10","``","followed","by","a","second","``","SearcherOperation","``","with","``",".length=20","``",".","Using","absolute","lengths","instead","of","incremental","lengths","makes","restarting","after","crashes","simple","and","robust","."]
docstr: ``report_completed()`` is the final step of a train-validate-report cycle.
  
  ``report_completed()`` requires the value of the metric you are searching over.  This value
  is typically the output of the "validate" step of the train-validate-report cycle.
  In most cases `searcher_metric` should be a `float` but custom search methods
  may use any json-serializable type as searcher metric.
docstr_tok: ["``","report_completed","(",")","``","is","the","final","step","of","a","train-validate-report","cycle",".","``","report_completed","(",")","``","requires","the","value","of","the","metric","you","are","searching","over",".","This","value","is","typically","the","output","of","the","``","validate","''","step","of","the","train-validate-report","cycle",".","In","most","cases","`","searcher_metric","`","should","be","a","`","float","`","but","custom","search","methods","may","use","any","json-serializable","type","as","searcher","metric","."]
code: def report_completed(self, searcher_metric: Any) -> None:
      """
      ``report_completed()`` is the final step of a train-validate-report cycle.
  
      ``report_completed()`` requires the value of the metric you are searching over.  This value
      is typically the output of the "validate" step of the train-validate-report cycle.
      In most cases `searcher_metric` should be a `float` but custom search methods
      may use any json-serializable type as searcher metric.
      """
      if not self._is_chief:
          raise RuntimeError(
              "you must only call op.report_completed() from the chief worker"
          )
      if self._completed:
          raise RuntimeError(
              "you may only call op.report_completed() once"
          )
      self._completed = True
      body = {
          "op": {"length": self._length},
          "searcherMetric": searcher_metric,
      }
      logger.debug(f"op.report_completed({searcher_metric})")
      self._session.post(
          f"/api/v1/trials/{self._trial_id}/searcher/completed_operation",
          data=det.util.json_encode(body),
      )
  
imports: import enum
  import logging
  from typing import Any, Iterator, Optional
  import determined
  from determined import core
  from determined.common import api
label_desc: Use image node_id 4 for calling the SearcherOperation obj's underlying member method code with example usage: obj.report_completed(searcher_metric) without return types