class_docstr: Defines how to apply the EPR algorithm.
class_docstr_tok: ["Defines","how","to","apply","the","EPR","algorithm","."]
code: def decompress_weights(
      self,
      string: tf.Tensor,
      weight_shape: tf.Tensor,
      log_step: tf.Tensor,
      cdf: tf.Tensor,
      cdf_offset: tf.Tensor,
  ) -> tf.Tensor:
      weight_shape = tf.cast(weight_shape, tf.int32)
      log_step = tf.cast(log_step, tf.float32)
      cdf = tf.cast(cdf, tf.int32)
      cdf_offset = tf.cast(cdf_offset, tf.int32)
      if weight_shape.shape[0] <= 2:
          # Bias or dense kernel.
          em = tfc.ContinuousBatchedEntropyModel(
              prior_shape=log_step.shape,
              cdf=cdf,
              cdf_offset=cdf_offset,
              coding_rank=weight_shape.shape[0],
              compression=True,
              stateless=True,
              offset_heuristic=False,
          )
          weight = em.decompress(string, weight_shape)
          return _transform_dense_weight(
              weight, log_step, quantized=True
          )
      else:
          # Convolution kernel.
          em = tfc.ContinuousBatchedEntropyModel(
              prior_shape=log_step.shape,
              cdf=cdf,
              cdf_offset=cdf_offset,
              coding_rank=weight_shape.shape[0] + 1,
              compression=True,
              stateless=True,
              offset_heuristic=False,
          )
          kernel_rdft = em.decompress(string, weight_shape[-2:])
          return _transform_conv_weight(
              kernel_rdft, weight_shape, log_step, quantized=True
          )
  
imports: import functools
  from typing import Callable, List, Tuple
  import tensorflow
  import tensorflow_compression
  from tensorflow_model_optimization.python.core.common.keras.compression import algorithm
label_desc: Use image node_id 4 for calling the EPR obj's underlying member method code with example usage: obj.decompress_weights(string, weight_shape, log_step, cdf, cdf_offset) and returns: _transform_dense_weight, _transform_conv_weight