code: def _pack_binary_form(value, target_bits):
      # Reshape the binary input to have target_bits columns, padding with zeros if
      # necessary to fit the dimension. The bitpacked representation is computed
      # as product with vector [1, 2, 4, ..., 2**target_bits].
      packing_vector = tf.constant(
          [[2**i] for i in range(target_bits)], value.dtype
      )
      extra_zeros = tf.zeros(
          tf.math.mod(-tf.shape(value), target_bits), value.dtype
      )
      reshaped_x = tf.reshape(
          tf.concat([value, extra_zeros], 0), [-1, target_bits]
      )
      return tf.matmul(reshaped_x, packing_vector)
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import logging
  import math
  import numpy
  import tensorflow
label_desc: Use image node_id 9 for calling a global function with example usage: _pack_binary_form(value, target_bits) and returns: tf