Have a question? Connect with the community at the TensorFlow Forum Visit Forum


Performs a softmax with optional masking on a tensor.

mask_expansion_axes Any axes that should be padded on the mask tensor.
normalization_axes On which axes the softmax should perform.



View source

This is where the layer's logic lives.

Note here that call() method in tf.keras is little bit different from keras API. In keras API, you can pass support masking for layers as additional arguments. Whereas tf.keras has compute_mask() method to support masking.

inputs Input tensor, or list/tuple of input tensors.
*args Additional positional arguments. Currently unused.
**kwargs Additional keyword arguments. Currently unused.

A tensor or list/tuple of tensors.