MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / compute_mask

Method compute_mask

tensorflow/python/keras/engine/base_layer.py:706–725  ·  view source on GitHub ↗

Computes an output mask tensor. Arguments: inputs: Tensor or list of tensors. mask: Tensor or list of tensors. Returns: None or a tensor (or list of tensors, one per output tensor of the layer).

(self, inputs, mask=None)

Source from the content-addressed store, hash-verified

704
705 @base_layer_utils.default
706 def compute_mask(self, inputs, mask=None): # pylint: disable=unused-argument
707 """Computes an output mask tensor.
708
709 Arguments:
710 inputs: Tensor or list of tensors.
711 mask: Tensor or list of tensors.
712
713 Returns:
714 None or a tensor (or list of tensors,
715 one per output tensor of the layer).
716 """
717 if not self.supports_masking:
718 if any(m is not None for m in nest.flatten(mask)):
719 raise TypeError('Layer ' + self.name + ' does not support masking, '
720 'but was passed an input_mask: ' + str(mask))
721 # masking not explicitly supported: return None as mask.
722 return None
723 # if masking is explicitly supported, by default
724 # carry over the input mask
725 return mask
726
727 def __call__(self, inputs, *args, **kwargs):
728 """Wraps `call`, applying pre- and post-processing steps.

Callers 1

_set_mask_metadataMethod · 0.95

Calls 2

anyFunction · 0.85
flattenMethod · 0.45

Tested by

no test coverage detected