Skip to content

[TorchFix] requires_grad check fails when condition #4687

Closed
@EgShes

Description

@EgShes

TorchFix failes to detect requres_grad mistyping when using condition instead of plain bool value

Here is the code to reproduce

import torch.nn as nn
model = nn.Module()

for name, param in model.named_parameters():
    param.require_grad = 'specific_layer' in name

TorchFix version: 0.1.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions