code: def nonpadding(self):
      
      if self.sequence_id is None:
        return None
      if self.sequence_id == 1:
        return 1
      else:
        return mtf.cast(
            mtf.not_equal(self.sequence_id, 0), self.activation_dtype)
docs: Tensor with zeros in padding positions and ones elsewhere.