class_docstr: Simple Channel that writes results to a TSV file.
class_docstr_tok: ["Simple","Channel","that","writes","results","to","a","TSV","file","."]
code: def report(
      self,
      stage,
      epoch,
      metrics,
      model_select_metric,
      loss,
      preds,
      targets,
      scores,
      context,
      *args,
  ):
      print(f"saving result to file {self.file_path}")
      with PathManager.open(
          self.file_path, "w", encoding="utf-8"
      ) as of:
          tsv_writer = csv.writer(
              of,
              delimiter="\t",
              quotechar='"',
              doublequote=True,
              lineterminator="\n",
              quoting=csv.QUOTE_MINIMAL,
          )
  
          tsv_writer.writerow(self.get_title(tuple(context.keys())))
          for row in self.gen_content(
              metrics, loss, preds, targets, scores, context
          ):
              tsv_writer.writerow(row)
  
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 2 for calling the FileChannel obj's underlying member method code with example usage: obj.report(stage, epoch, metrics, model_select_metric, loss, preds, targets, scores, context) without return types