class_docstr: Quaternion Knowledge Graph Embedding.
  https://arxiv.org/abs/1904.10281
class_docstr_tok: ["Quaternion","Knowledge","Graph","Embedding",".","https",":","\/\/arxiv.org\/abs\/1904.10281"]
code: def _get_part_score(self, a, b):
      a = paddle.chunk(a, chunks=4, axis=-1)
      b = paddle.chunk(b, chunks=4, axis=-1)
  
      denominator_b = paddle.sqrt(
          b[0] ** 2 + b[1] ** 2 + b[2] ** 2 + b[3] ** 2 + 1e-10
      )
      b[0] = b[0] / denominator_b
      b[1] = b[1] / denominator_b
      b[2] = b[2] / denominator_b
      b[3] = b[3] / denominator_b
  
      A = a[0] * b[0] - a[1] * b[1] - a[2] * b[2] - a[3] * b[3]
      B = a[0] * b[1] + a[1] * b[0] + a[2] * b[3] - a[3] * b[2]
      C = a[0] * b[2] - a[1] * b[3] + a[2] * b[0] + a[3] * b[1]
      D = a[0] * b[3] + a[1] * b[2] - a[2] * b[1] + a[3] * b[0]
  
      return A, B, C, D
  
imports: import math
  import numpy
  from numpy.random import RandomState
  import paddle
  import paddle.nn
  import paddle.nn.functional
  from paddle.nn.functional import log_sigmoid
label_desc: Use image node_id 4 for calling the QuatEScore obj's underlying member method code with example usage: obj._get_part_score(a, b) and returns: A,  B,  C,  D