Skip to content

if there's no "if shared_param.grad is not None: return" what will happen? #79

@yinqinghai

Description

@yinqinghai
        if shared_param.grad is not None:
            return
        shared_param._grad = param.grad

in this code, if there's no if shared_param.grad is not None: return shared_param._grad will be assigned each time? maybe just some performance loss?
maybe a stupid question, but i'm curious, thanks in advance.

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