def call(self, inputs=None):
    tile, index, biases = 1, None, []
    len_q = self.total_length

    for i, s in enumerate(self.lengths):
      # Relative attention in every dimension separately.
      if s > 1:
        new_bias = att_utils.relative_attn_bias(
            self.biases[i], self.num_heads, index)
        repeat = self.total_length // (tile * s)
        if repeat > 1:
          new_bias = tf.expand_dims(new_bias, -1)
          new_bias = tf.tile(new_bias, [tile, repeat, tile, repeat])
          new_bias = tf.reshape(new_bias,
                                [len_q, self.num_heads, self.total_length])
        elif tile > 1:
          new_bias = tf.tile(new_bias, [tile, 1, tile])
        tile *= s
        biases.append(new_bias)

    return tf.add_n(biases)