jactorch.nn.gumbel_softmax.softmax#

Classes

Class GeneralSoftmax

class GeneralSoftmax[source]#

Bases: Module

__init__(dim=-1, tau=1.0, impl='standard')[source]#

Initialize internal Module state, shared by both nn.Module and ScriptModule.

forward(logits, mask=None)[source]#

Define the computation performed at every call.

Should be overridden by all subclasses.

Note

Although the recipe for forward pass needs to be defined within this function, one should call the Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.

Class GumbelSoftmax

class GumbelSoftmax[source]#

Bases: Module

__init__(dim=-1, tau=1.0, hard=False, eps=1e-10)[source]#

Initialize internal Module state, shared by both nn.Module and ScriptModule.

forward(logits, mask=None)[source]#

Define the computation performed at every call.

Should be overridden by all subclasses.

Note

Although the recipe for forward pass needs to be defined within this function, one should call the Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.