torchact.nn.Step

class torchact.nn.Step[source]

Implementation of binary step activation.

Examples::
>>> import torch, torchact
>>> m = torchact.nn.Step()
>>> input = torch.tensor([1.0, -2.0, 0.0, 3.0])
>>> output = m(input)
>>> print(output)
tensor([1, 0, 0, 1])