diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d84c82e..8ea6e0f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -28,6 +28,10 @@ jobs: uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} + - name: Clean pip cache + run: pip cache purge + - name: Check disk space + run: df -h - name: Install dependencies run: | pip install . diff --git a/clu/metric_writers/logging_writer.py b/clu/metric_writers/logging_writer.py index e608936..40b9e2e 100644 --- a/clu/metric_writers/logging_writer.py +++ b/clu/metric_writers/logging_writer.py @@ -138,7 +138,7 @@ def _compute_histogram_as_tf( range_max = np.max(array) range_min = np.min(array) - if range_max == range_min: + if np.isclose(range_max, range_min, rtol=1e-5, atol=1e-8): histo = np.asarray([array.size], dtype=np.int64) bins = np.asarray([range_max - 0.5, range_max + 0.5], dtype=np.float64) else: