[hotfix] set return_outputs=False in examples and polish code (#5404)

* fix: simplify merge_batch

* fix: use return_outputs=False to eliminate extra memory consumption

* feat: add return_outputs warning

* style: remove `return_outputs=False` as it is the default value
This commit is contained in:
Wenhao Chen
2024-03-25 12:31:09 +08:00
committed by GitHub
parent 5fcd7795cd
commit bb0a668fee
24 changed files with 28 additions and 36 deletions

View File

@@ -120,7 +120,7 @@ def main():
# run pipeline forward backward
batch = iter([batch])
outputs = booster.execute_pipeline(
batch, model, criterion, optimizer, return_loss=True, return_outputs=True
batch, model, criterion, optimizer, return_loss=True
)
else:
outputs = model(**batch)