class_docstr: ``TrainContext`` gives access to report training and validation metrics to the Determined master
  during trial tasks.
class_docstr_tok: ["``","TrainContext","``","gives","access","to","report","training","and","validation","metrics","to","the","Determined","master","during","trial","tasks","."]
docstr: Upload files generated for consumption by Tensorboard to checkpoint storage.
  
  Args:
      selector: optional function returning True for a file that should be included.
          If not provided, all files are uploaded.
      mangler: optional function modifying the destination file names based on rank.
docstr_tok: ["Upload","files","generated","for","consumption","by","Tensorboard","to","checkpoint","storage",".","Args",":","selector",":","optional","function","returning","True","for","a","file","that","should","be","included",".","If","not","provided",",","all","files","are","uploaded",".","mangler",":","optional","function","modifying","the","destination","file","names","based","on","rank","."]
code: def upload_tensorboard_files(
      self,
      selector: Callable[[pathlib.Path], bool] = lambda _: True,
      mangler: Callable[
          [pathlib.Path, int], pathlib.Path
      ] = lambda p, __: p,
  ) -> None:
      """
      Upload files generated for consumption by Tensorboard to checkpoint storage.
  
      Args:
          selector: optional function returning True for a file that should be included.
              If not provided, all files are uploaded.
          mangler: optional function modifying the destination file names based on rank.
      """
      if self._tensorboard_mode == core.TensorboardMode.AUTO:
          raise RuntimeError(
              "upload_tensorboard_files can only be used in MANUAL mode"
          )
  
      if self._tensorboard_manager is None:
          raise ValueError(
              "tensorboard manager is required for this method"
          )
      assert self._tensorboard_manager is not None
      self._tensorboard_manager.sync(
          selector, mangler, self._distributed.rank
      )
  
imports: import enum
  import logging
  import pathlib
  from typing import Any, Callable, Dict, List, Optional, Set
  import determined
  from determined import core, tensorboard
  from determined.common import api, util
  from determined.common.api import bindings, errors
label_desc: Use image node_id 9 for calling the TrainContext obj's underlying member method code with example usage: obj.upload_tensorboard_files(selector, mangler) without return types