6ed7ad98f7a9466b4a9940119f02c67ff430a29e,deepexplain/tensorflow/methods.py,,original_grad,#Any#Any#,39

Before Change




def original_grad(op, grad):
    a_name = next((x for x in SUPPORTED_ACTIVATIONS if x in op.name.lower()), None)
    if a_name is None:
        raise RuntimeError("Activation function (%s) not supported" % op.name.lower())
    f = getattr(nn_grad, "_%sGrad" % a_name.capitalize())
    return f(op, grad)

After Change




def original_grad(op, grad):
    if op.type not in SUPPORTED_ACTIVATIONS:
        warnings.warn("Activation function (%s) not supported" % op.type)
    f = getattr(nn_grad, "_%sGrad" % op.type)
    return f(op, grad)

Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: marcoancona/DeepExplain
Commit Name: 6ed7ad98f7a9466b4a9940119f02c67ff430a29e
Time: 2017-11-06
Author: marco.ancona@inf.ethz.ch
File Name: deepexplain/tensorflow/methods.py
Class Name:
Method Name: original_grad


Project Name: catalyst-cooperative/pudl
Commit Name: fc44c71d4aa2e8a5ef60effd4bfe7fb82dffbf17
Time: 2021-01-06
Author: rousik@gmail.com
File Name: src/pudl/extract/ferc1.py
Class Name: Ferc1Datastore
Method Name: get_file


Project Name: ray-project/ray
Commit Name: d7c95a4a9065cbad73901b4c1de087837e260316
Time: 2020-11-17
Author: simon.mo@hey.com
File Name: python/ray/serve/api.py
Class Name: Client
Method Name: get_handle