Skip to content

requires_grad=True for an input datapoint? #2860

@ggbioing

Description

@ggbioing

x = torch.randn(batch_size, 1, 224, 224, requires_grad=True)

It is obscure to me why there is the need to set the flag requires_grad to True for datapoint "x", which has no parameters to be learnt.
Is it something required to export the model in onnx?

Thanks.

cc @titaiwangms @xadupre @justinchuby @BowenBao

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions