Skip to content

Commit

Permalink
Fix for compression of integer tensors:
Browse files Browse the repository at this point in the history
- Encoder and decoder crashed during compression/decompression of integer tensors
  • Loading branch information
phaase-hhi committed Jan 10, 2023
1 parent cf7ce60 commit dbd7517
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion nnc_core/approximator/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,7 @@ def run_ft_and_lsa(model_info, approx_data, ap_info, model_executer, block_id_an
def approx(approx_info, model_info, approx_data, param_opt=0):
approx_method = approx_info['approx_method']

integer.skip_approx( approx_info, model_info, approx_data )
approx_data = integer.skip_approx( approx_info, model_info, approx_data )

if approx_method == 'codebook':
approx_data, approx_info = codebook.approx(approx_info, model_info, approx_data, param_opt)
Expand Down
2 changes: 1 addition & 1 deletion nnc_core/coder/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ def __decode_nnr_ndu_unit(nnr_gen, reader, bitstream, ndu, mps, lps, tpl, model_
approx_data["codebooks_egk"][param] = ndu["codebook_egk__"]
elif(
(ndu["nnr_compressed_data_unit_payload_type"] != hls.CompressedDataUnitPayloadType.NNR_PT_BLOCK) and
(ndu["codebook_present_flag"] == 1)
(ndu.get("codebook_present_flag") == 1)
):
approx_data["approx_method"][param] = 'codebook'
approx_data["codebooks"][param] = ndu["codebook__"]
Expand Down
3 changes: 3 additions & 0 deletions nnc_core/coder/baseline.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ def decode( decoder, approx_data, param, ndu, mps, lps ):
qp_density = lps["lps_qp_density"] if lps is not None else mps["mps_qp_density"]
approx_data["qp"][param] = np.int32(decoder.iae_v( 6 + qp_density ) + quantization_parameter)
approx_data["dq_flag"][param] = ndu["dq_flag"]

else:
approx_data["dq_flag"][param] = 0

decoder.initCtxModels( ndu["cabac_unary_length_minus1"] )
scan_order = ndu.get("scan_order", 0)
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
from setuptools.command.build_ext import build_ext
import setuptools

__version__ = '0.1.2'
__version__ = '0.1.3'


class get_pybind_include(object):
Expand Down

0 comments on commit dbd7517

Please sign in to comment.