def build_inception_model(align_tf=True):
    """Builds Inception V3 model.

    This model is particular used for inference, such that `requires_grad` and
    `mode` will both be set as `False`.

    Args:
        align_tf: Whether to align the implementation with TensorFlow version. (default: True)

    Returns:
        A `torch.nn.Module` with pre-trained weight.
    """
    if align_tf:
        num_classes = 1008
        model_url = model_urls['tf_inception_v3']
    else:
        num_classes = 1000
        model_url = model_urls['inception_v3_google']
    model = Inception3(num_classes=num_classes,
                       aux_logits=False,
                       transform_input=False,
                       align_tf=align_tf)
    state_dict = load_state_dict_from_url(model_url)
    model.load_state_dict(state_dict, strict=False)
    model.eval()
    for param in model.parameters():
        param.requires_grad = False
    return model
Builds Inception V3 model.

    This model is particular used for inference, such that `requires_grad` and
    `mode` will both be set as `False`.

    Args:
        align_tf: Whether to align the implementation with TensorFlow version. (default: True)

    Returns:
        A `torch.nn.Module` with pre-trained weight.
    
metrics/inception.py