@classmethod
def validate_train_opts(cls, opt):
    if opt.epochs:
        raise AssertionError('-epochs is deprecated please use -train_steps.')
    if ((opt.truncated_decoder > 0) and (max(opt.accum_count) > 1)):
        raise AssertionError('BPTT is not compatible with -accum > 1')
    if opt.gpuid:
        raise AssertionError('gpuid is deprecated see world_size and gpu_ranks')
    if (torch.cuda.is_available() and (not opt.gpu_ranks)):
        logger.info('WARNING: You have a CUDA device,                         should run with -gpu_ranks')
    if (opt.world_size < len(opt.gpu_ranks)):
        raise AssertionError('parameter counts of -gpu_ranks must be less or equal than -world_size.')
    if ((opt.world_size == len(opt.gpu_ranks)) and (min(opt.gpu_ranks) > 0)):
        raise AssertionError('-gpu_ranks should have master(=0) rank unless -world_size is greater than len(gpu_ranks).')
    assert (len(opt.data_ids) == len(opt.data_weights)), 'Please check -data_ids and -data_weights options!'
    assert (len(opt.dropout) == len(opt.dropout_steps)), 'Number of dropout values must match accum_steps values'
    assert (len(opt.attention_dropout) == len(opt.dropout_steps)), 'Number of attention_dropout values must match accum_steps values'
@classmethod
def validate_train_opts(cls, opt):
    if opt.epochs:
        raise AssertionError('-epochs is deprecated please use -train_steps.')
    if ((opt.truncated_decoder > 0) and (max(opt.accum_count) > 1)):
        raise AssertionError('BPTT is not compatible with -accum > 1')
    if opt.gpuid:
        raise AssertionError('gpuid is deprecated see world_size and gpu_ranks')
    if (torch.cuda.is_available() and (not opt.gpu_ranks)):
        logger.info('WARNING: You have a CUDA device,                         should run with -gpu_ranks')
    if (opt.world_size < len(opt.gpu_ranks)):
        raise AssertionError('parameter counts of -gpu_ranks must be less or equal than -world_size.')
    if ((opt.world_size == len(opt.gpu_ranks)) and (min(opt.gpu_ranks) > 0)):
        raise AssertionError('-gpu_ranks should have master(=0) rank unless -world_size is greater than len(gpu_ranks).')
    assert (len(opt.data_ids) == len(opt.data_weights)), 'Please check -data_ids and -data_weights options!'
    assert (len(opt.dropout) == len(opt.dropout_steps)), 'Number of dropout values must match accum_steps values'
    assert (len(opt.attention_dropout) == len(opt.dropout_steps)), 'Number of attention_dropout values must match accum_steps values'