Skip to content

Is the operation "torch.max" differentiable? #1

@tangcongyi

Description

@tangcongyi

Thank you for your contribution! There is a question for you:
In keep_autoaugment.py, there are some codes:

"images_half.requires_grad = True

    if self.early:
        preds = model(images_half,True)
    else:
        preds = model(images_half)
    
    **score, _ = torch.max(preds, 1)**
    score.mean().backward()
    slc_, _ = torch.max(torch.abs(images_half.grad), dim=1)"

Is the operation "torch.max" differentiable?In my project, it seems to stop the process of backward.

I would appreciate that if you could help me to handle this question!!!!!!!!!!!!!!!!!!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions