|View source on GitHub|
Performs a softmax with optional masking on a tensor.
tfnlp.layers.MaskedSoftmax( mask_expansion_axes=None, normalization_axes=None, **kwargs )
||Any axes that should be padded on the mask tensor.|
||On which axes the softmax should perform.|
call( scores, mask=None )
This is where the layer's logic lives.
Note here that
call() method in
tf.keras is little bit different
keras API. In
keras API, you can pass support masking for
layers as additional arguments. Whereas
method to support masking.
||Input tensor, or list/tuple of input tensors.|
||Additional positional arguments. Currently unused.|
||Additional keyword arguments. Currently unused.|
|A tensor or list/tuple of tensors.|