class_docstr: Differentiable shape rendering layer using multiple convex polytopes.
class_docstr_tok: ["Differentiable","shape","rendering","layer","using","multiple","convex","polytopes","."]
docstr: Compute signed distances between query points and hyperplanes.
docstr_tok: ["Compute","signed","distances","between","query","points","and","hyperplanes","."]
code: def _compute_sdf(self, x, translations, blend_terms, points):
      """Compute signed distances between query points and hyperplanes."""
      n_parts = tf.shape(x)[1]
      n_planes = tf.shape(x)[2]
      norm_logit = x[..., 0 : self._dims - 1]
      offset = -(
          tf.nn.sigmoid(x[..., self._dims - 1 : self._dims])
          * self._offset_scale
          + self._offset_lbound
      )
      blend_planes = (
          tf.nn.sigmoid(blend_terms[..., :n_parts]) * self._blend_scale
          + self._blend_lbound
      )
  
      # Norm of the boundary line
      norm_rad = (
          tf.tanh(norm_logit) * np.pi
      )  # [..., (azimuth, altitude)]
      if self._dims == 3:
          norm = tf.stack(
              [
                  tf.sin(norm_rad[..., 1]) * tf.cos(norm_rad[..., 0]),
                  tf.sin(norm_rad[..., 1]) * tf.sin(norm_rad[..., 0]),
                  tf.cos(norm_rad[..., 1]),
              ],
              axis=-1,
          )
      else:
          norm = tf.concat(
              [tf.cos(norm_rad), tf.sin(norm_rad)], axis=-1
          )
  
      # Calculate signed distances to hyperplanes.
      points = tf.expand_dims(points, axis=1) - tf.expand_dims(
          translations, axis=2
      )
      points = tf.expand_dims(points, axis=2)
      points = tf.tile(points, [1, 1, n_planes, 1, 1])
      signed_dis = tf.matmul(points, tf.expand_dims(norm, axis=-1))
      signed_dis = signed_dis + tf.expand_dims(offset, axis=-2)
  
      return signed_dis, translations, blend_planes, offset
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import numpy
  import tensorflow.compat.v1
  from tensorflow_graphics.projects.cvxnet.lib import resnet
label_desc: Use image node_id 3 for calling the MultiConvexUnit obj's underlying member method code with example usage: obj._compute_sdf(x, translations, blend_terms, points) and returns: signed_dis,  translations,  blend_planes,  offset