docstr: Initializes the train_step function to train the model on batches of data.
  
  Args:
      loss_function: Loss function to perform backprop on.
      batch_size: Batch size to use for training.
      apply_gradients: Whether to apply the gradients, i.e.
          False if you want to validate the model on test data.
  
  Returns: Train step function that is applied to a batch and returns the loss.
docstr_tok: ["Initializes","the","train_step","function","to","train","the","model","on","batches","of","data",".","Args",":","loss_function",":","Loss","function","to","perform","backprop","on",".","batch_size",":","Batch","size","to","use","for","training",".","apply_gradients",":","Whether","to","apply","the","gradients",",","i.e",".","False","if","you","want","to","validate","the","model","on","test","data",".","Returns",":","Train","step","function","that","is","applied","to","a","batch","and","returns","the","loss","."]
code: def new_train_step(
      self,
      loss_function: Callable[[tf.Tensor], tf.Tensor],
      batch_size: int,
      apply_gradients=True,
  ) -> Callable[[tf.Tensor, tf.Tensor], float]:
      """
      Initializes the train_step function to train the model on batches of data.
  
      Args:
          loss_function: Loss function to perform backprop on.
          batch_size: Batch size to use for training.
          apply_gradients: Whether to apply the gradients, i.e.
              False if you want to validate the model on test data.
  
      Returns: Train step function that is applied to a batch and returns the loss.
  
      """
  
      pass
  
file_path: headliner/headliner/model/summarizer.py
imports: import abc
  from abc import abstractmethod
  from typing import Callable, Dict, Union
  import numpy
  import tensorflow
  from headliner.preprocessing import Preprocessor, Vectorizer
label_desc: Use image node_id 5 for calling the Summarizer obj's underlying member method code with example usage: obj.new_train_step(loss_function, batch_size, apply_gradients) without return types