class_docstr: Defines how to apply a faster version of the EPR algorithm.
class_docstr_tok: ["Defines","how","to","apply","a","faster","version","of","the","EPR","algorithm","."]
code: def decompress_weights(
      self,
      string: tf.Tensor,
      weight_shape: tf.Tensor,
      log_step: tf.Tensor,
  ) -> tf.Tensor:
      weight_shape = tf.cast(weight_shape, tf.int32)
      log_step = tf.cast(log_step, tf.float32)
      if weight_shape.shape[0] <= 2:
          # Bias or dense kernel.
          em = tfc.PowerLawEntropyModel(
              coding_rank=weight_shape.shape[0], alpha=self.alpha
          )
          weight = em.decompress(string, weight_shape)
          return _transform_dense_weight(
              weight, log_step, quantized=True
          )
      else:
          # Convolution kernel.
          em = tfc.PowerLawEntropyModel(
              coding_rank=weight_shape.shape[0] + 1, alpha=self.alpha
          )
          kernel_rdft = em.decompress(
              string,
              tf.concat([weight_shape[-2:], tf.shape(log_step)], 0),
          )
          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 5 for calling the FastEPR obj's underlying member method code with example usage: obj.decompress_weights(string, weight_shape, log_step) and returns: _transform_dense_weight, _transform_conv_weight