Skip to content

Commit

Permalink
fix(serialization): Don't use obsolete np.product alias for np.prod
Browse files Browse the repository at this point in the history
This fixes compatibility with numpy>=2.0.0, which removed np.product
as an alias for np.prod.
  • Loading branch information
Eta0 committed Feb 18, 2025
1 parent 2cee68a commit 0d25dfc
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

### Fixed

- Fixed compatibility with `numpy>=2.0.0`
- Calls to the removed `numpy.product` function now use `numpy.prod` instead

## [2.9.1] - 2024-11-27

### Fixed
Expand Down Expand Up @@ -409,6 +416,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- `get_gpu_name`
- `no_init_or_tensor`

[Unreleased]: https://github.com/coreweave/tensorizer/compare/v2.9.1...HEAD
[2.9.1]: https://github.com/coreweave/tensorizer/compare/v2.9.0...v2.9.1
[2.9.0]: https://github.com/coreweave/tensorizer/compare/v2.8.1...v2.9.0
[2.8.1]: https://github.com/coreweave/tensorizer/compare/v2.8.0...v2.8.1
Expand Down
2 changes: 1 addition & 1 deletion tensorizer/_version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "2.9.1"
__version__ = "2.9.2"
2 changes: 1 addition & 1 deletion tensorizer/serialization.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ def deserialized_length(self):
if self.data_length > 0:
return self.data_length
element_size: int = numpy.dtype(self.dtype).itemsize
num_elements: int = numpy.product(self.shape)
num_elements: int = numpy.prod(self.shape)
return element_size * num_elements


Expand Down

0 comments on commit 0d25dfc

Please sign in to comment.