class_docstr: TensorBoardChannel defines how to format and report the result of a PyText
  job to TensorBoard.
  
  Attributes:
      summary_writer: An instance of the TensorBoard SummaryWriter class, or
          an object that implements the same interface.
          https://pytorch.org/docs/stable/tensorboard.html
      metric_name: The name of the default metric to display on the
          TensorBoard dashboard, defaults to "accuracy"
      train_step: The training step count
class_docstr_tok: ["TensorBoardChannel","defines","how","to","format","and","report","the","result","of","a","PyText","job","to","TensorBoard",".","Attributes",":","summary_writer",":","An","instance","of","the","TensorBoard","SummaryWriter","class",",","or","an","object","that","implements","the","same","interface",".","https",":","\/\/pytorch.org\/docs\/stable\/tensorboard.html","metric_name",":","The","name","of","the","default","metric","to","display","on","the","TensorBoard","dashboard",",","defaults","to","``","accuracy","''","train_step",":","The","training","step","count"]
code: def log_vector(self, key, val, epoch):
      if len(val) > 0 and not (val == 0).all():
          try:
              self.summary_writer.add_histogram(key, val, epoch)
          except Exception:
              print(
                  f"WARNING: Param {key} "
                  "cannot be sent to Tensorboard",
                  file=sys.stderr,
              )
              traceback.print_exc(file=sys.stderr)
  
imports: import csv
  import sys
  import traceback
  from typing import Tuple
  import numpy
  import torch
  from numpy import linalg
  from pytext.common.constants import Stage
  from pytext.utils.file_io import PathManager
  from torch.utils.tensorboard import SummaryWriter
label_desc: Use image node_id 4 for calling the TensorBoardChannel obj's underlying member method code with example usage: obj.log_vector(key, val, epoch) without return types