def get_effective_batch_size(opts):
    """Returns effective batch size

    :param dict opts: A dictionary containing benchmark parameters. Must contain
                      `batch_size`, `device` and optionally `num_gpus`.
    :return: Effective batch size.
    :rtype: int
    """
    num_devices = 1 if opts['device'] == 'cpu' else opts['num_gpus']
    return opts['batch_size'] * num_devices