Skip to content

Commit

Permalink
fix code style
Browse files Browse the repository at this point in the history
  • Loading branch information
Feilei Du committed May 29, 2023
1 parent e6005bf commit ae86109
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@


def convert_model(args, model: nn.Module) -> nn.Module:
if args.vendor == 'kunlunxin':
# not support yet
return model
if utils.is_dist_avail_and_initialized() and args.sync_bn:
model = torch.nn.SyncBatchNorm.convert_sync_batchnorm(model)
return model
Expand Down Expand Up @@ -62,6 +65,9 @@ def create_optimizer(args, model):


def model_to_fp16(args, model):
if args.vendor == 'kunlunxin':
# not support yet
return model
# To prevent OOM for model sizes that cannot fit in GPU memory in full precision
if args.fp16:
main_proc_print(" > use fp16...")
Expand All @@ -76,6 +82,9 @@ def model_to_ddp(args, model: nn.Module) -> nn.Module:


def create_grad_scaler(args):
if args.vendor == 'kunlunxin':
# not support yet
return None
scaler = torch.cuda.amp.GradScaler() if args.amp else None
return scaler

Expand Down
Empty file.
13 changes: 0 additions & 13 deletions training/kunlunxin/efficientnet-pytorch/extern/trainer_adapter.py

This file was deleted.

0 comments on commit ae86109

Please sign in to comment.