@error_handling_agent.catch_smdebug_errors()
def forward_pre_hook(self, block, inputs):
    if (self.writer is not None):
        self._log_params(block)
        self._close_writers()
    self._close_tb_writer()
    if (not self.prepared_collections):
        self._prepare_collections()
        self.prepared_collections = True
    self._increment_step()
    if self._get_collections_to_save_for_step():
        self._initialize_writers()
    if (self.exported_model is False):
        self._export_model()
        self.exported_model = True
    if ((self.last_saved_step is not None) and (not self.exported_collections)):
        self.export_collections()
        self.exported_collections = True
    self.last_block = block
    self._save_custom_tensors_post_step()
@error_handling_agent.catch_smdebug_errors()
def forward_pre_hook(self, block, inputs):
    if (self.writer is not None):
        self._log_params(block)
        self._close_writers()
    self._close_tb_writer()
    if (not self.prepared_collections):
        self._prepare_collections()
        self.prepared_collections = True
    self._increment_step()
    if self._get_collections_to_save_for_step():
        self._initialize_writers()
    if (self.exported_model is False):
        self._export_model()
        self.exported_model = True
    if ((self.last_saved_step is not None) and (not self.exported_collections)):
        self.export_collections()
        self.exported_collections = True
    self.last_block = block
    self._save_custom_tensors_post_step()