def build_train_args(self, batch, batch_idx, opt_idx, hiddens):
    args = [batch, batch_idx]
    if (len(self.trainer.optimizers) > 1):
        if self.trainer.has_arg('training_step', 'optimizer_idx'):
            if (not self.trainer.lightning_module.automatic_optimization):
                self.warning_cache.warn('`training_step` hook signature has changed in v1.3. `optimizer_idx` argument has been removed in case of manual optimization. Support for the old signature will be removed in v1.5', DeprecationWarning)
            args.append(opt_idx)
        elif ((not self.trainer.has_arg('training_step', 'optimizer_idx')) and self.trainer.lightning_module.automatic_optimization):
            raise ValueError(f'Your LightningModule defines {len(self.trainer.optimizers)} optimizers but `training_step` is missing the `optimizer_idx` argument.')
    if self._truncated_bptt_enabled():
        args.append(hiddens)
    return args
def build_train_args(self, batch, batch_idx, opt_idx, hiddens):
    args = [batch, batch_idx]
    if (len(self.trainer.optimizers) > 1):
        if self.trainer.has_arg('training_step', 'optimizer_idx'):
            if (not self.trainer.lightning_module.automatic_optimization):
                self.warning_cache.warn('`training_step` hook signature has changed in v1.3. `optimizer_idx` argument has been removed in case of manual optimization. Support for the old signature will be removed in v1.5', DeprecationWarning)
            args.append(opt_idx)
        elif ((not self.trainer.has_arg('training_step', 'optimizer_idx')) and self.trainer.lightning_module.automatic_optimization):
            raise ValueError(f'Your LightningModule defines {len(self.trainer.optimizers)} optimizers but `training_step` is missing the `optimizer_idx` argument.')
    if self._truncated_bptt_enabled():
        args.append(hiddens)
    return args