Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def __init__(self,
activation_type,
d_out,
bidirectional=False,
has_skip_term=True,
scale_x=1,
mask_pad=None):
super(SRU_Compute_GPU, self).__init__()
self.activation_type = activation_type
self.d_out = d_out
self.bidirectional = bidirectional
self.has_skip_term = has_skip_term
self.scale_x = scale_x
# ensure mask_pad is a byte tensor
mask_pad = mask_pad.byte().contiguous() if mask_pad is not None else None
self.mask_pad = mask_pad