docstr: Affinity score between batch of inputs1 and inputs2.
  Args:
      inputs1: tensor of shape [batch_size x feature_size].
docstr_tok: ["Affinity","score","between","batch","of","inputs1","and","inputs2",".","Args",":","inputs1",":","tensor","of","shape","[","batch_size","x","feature_size","]","."]
code: def affinity(self, inputs1, inputs2):
      """Affinity score between batch of inputs1 and inputs2.
      Args:
          inputs1: tensor of shape [batch_size x feature_size].
      """
      # shape: [batch_size, input_dim1]
      if self.bilinear_weights:
          prod = tf.matmul(inputs2, tf.transpose(self.vars["weights"]))
          self.prod = prod
          result = tf.reduce_sum(inputs1 * prod, axis=1)
      else:
          result = tf.reduce_sum(inputs1 * inputs2, axis=1)
      return result
  
file_path: GraphSAGE/graphsage/prediction.py
imports: from __future__ import division
  from __future__ import print_function
  from graphsage.inits import zeros
  from graphsage.layers import Layer
  import tensorflow
label_desc: Use image node_id 2 for calling the BipartiteEdgePredLayer obj's underlying member method code with example usage: obj.affinity(inputs1, inputs2) and returns: result