Skip to content

Commit

Permalink
Bugfix for compression of arbitrary numpy dictionaries with 'compress':
Browse files Browse the repository at this point in the history
- The encoder crashed during encoding of arbitrary numpy dictionaries with the 'compress' function. This was caused by missing entries for the parameter types in the model_information dictionary.
  • Loading branch information
phaase-hhi committed Jan 17, 2023
1 parent c7f9575 commit 13a2fce
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ source env/bin/activate

**Note**: For further information on how to set up a virtual python environment (also on **Windows**) refer to https://docs.python.org/3/library/venv.html .

When successfully installed, the software outputs the line : "Successfully installed NNC-0.1.5"
When successfully installed, the software outputs the line : "Successfully installed NNC-0.1.6"

### Importing the main module

Expand Down
10 changes: 5 additions & 5 deletions nnc_core/nnr_model/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,12 +165,12 @@ def init_model_from_dict(self, model_dict):
model_info['parameter_dimensions'][module_name] = np.array([0]).shape
model_info['parameter_index'][module_name] = i

dims = len(mdl_shape)
dims = len(mdl_shape)

if dims > 1:
model_info['parameter_type'][module_name] = 'weight'
else:
model_info['parameter_type'][module_name] = 'unspecified'
if dims > 1:
model_info['parameter_type'][module_name] = 'weight'
else:
model_info['parameter_type'][module_name] = 'unspecified'

model_info['topology_storage_format'] = nnc_core.nnr_model.TopologyStorageFormat.NNR_TPL_UNREC
model_info['topology_compression_format'] = nnc_core.nnr_model.TopologyCompressionFormat.NNR_PT_RAW
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.5'
__version__ = '0.1.6'


class get_pybind_include(object):
Expand Down

0 comments on commit 13a2fce

Please sign in to comment.