[QA] Remove commented-out torch.jit.script
decorators
This commit is contained in:
parent
b1e64c8b8b
commit
2a7394b593
@ -5,17 +5,14 @@ import torch
|
|||||||
ACTIVATIONS = dict()
|
ACTIVATIONS = dict()
|
||||||
|
|
||||||
|
|
||||||
# def register_activation(scriptf):
|
def register_activation(fn):
|
||||||
# ACTIVATIONS[scriptf.name] = scriptf
|
|
||||||
# return scriptf
|
|
||||||
def register_activation(function):
|
|
||||||
"""Add the activation function to the registry."""
|
"""Add the activation function to the registry."""
|
||||||
ACTIVATIONS[function.__name__] = function
|
name = fn.__name__
|
||||||
return function
|
ACTIVATIONS[name] = fn
|
||||||
|
return fn
|
||||||
|
|
||||||
|
|
||||||
@register_activation
|
@register_activation
|
||||||
# @torch.jit.script
|
|
||||||
def identity(x, beta=0.0):
|
def identity(x, beta=0.0):
|
||||||
"""Identity activation function.
|
"""Identity activation function.
|
||||||
|
|
||||||
@ -29,7 +26,6 @@ def identity(x, beta=0.0):
|
|||||||
|
|
||||||
|
|
||||||
@register_activation
|
@register_activation
|
||||||
# @torch.jit.script
|
|
||||||
def sigmoid_beta(x, beta=10.0):
|
def sigmoid_beta(x, beta=10.0):
|
||||||
r"""Sigmoid activation function with scaling.
|
r"""Sigmoid activation function with scaling.
|
||||||
|
|
||||||
@ -44,7 +40,6 @@ def sigmoid_beta(x, beta=10.0):
|
|||||||
|
|
||||||
|
|
||||||
@register_activation
|
@register_activation
|
||||||
# @torch.jit.script
|
|
||||||
def swish_beta(x, beta=10.0):
|
def swish_beta(x, beta=10.0):
|
||||||
r"""Swish activation function with scaling.
|
r"""Swish activation function with scaling.
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user