def METHOD_NAME(self, value):
    right = value
    # first transform v_i depending on the interaction type
    if self.interaction_type is None:
        left = value
    elif self.interaction_type == "field_all":
        left = tf.matmul(value, self.kernel)
    elif self.interaction_type == "field_each":
        left = tf.einsum("b...k,...jk->b...j", value, self.kernel)
    else:
        left = tf.einsum("b...k,f...jk->bf...j", value, self.kernel)
    # do the interaction between v_i and v_j
    # output shape will be (batch_size, num_features, num_features)
    if self.interaction_type != "field_interaction":
        interactions = tf.matmul(left, right, transpose_b=True)
    else:
        interactions = tf.einsum("b...jk,b...k->b...j", left, right)
    # mask out the appropriate area
    ones = tf.reduce_sum(tf.zeros_like(interactions), axis=0) + 1
    mask = tf.linalg.band_part(ones, 0, -1)  # set lower diagonal to zero
    if not self.self_interaction:
        mask = mask - tf.linalg.band_part(ones, 0, 0)  # get rid of diagonal
    mask = tf.cast(mask, tf.bool)
    x = tf.boolean_mask(interactions, mask, axis=1)
    # masking destroys shape information, set explicitly
    x.set_shape(self.compute_output_shape(value.shape))
    return x