1. 18 2月, 2025 2 次提交
    • Virgile Andreani's avatar
      Changes for numpy 2.0 deprecations · ca089790
      Virgile Andreani 提交于
      - Replace np.cast with np.asarray: in numpy 2.0,
        `np.cast[new_dtype](arr)` is deprecated.
        The literal replacement is `np.asarray(arr, dtype=new_dtype)`.
      
      - Replace np.sctype2char and np.obj2sctype.
        Added try/except to handle change in behavior
        of `np.dtype`
      
      - Replace np.find_common_type with np.result_type
      
      Further changes to `TensorType`:
      
      TensorType.dtype must be a string, so the code
      has been changed from `self.dtype = np.dtype(dtype).type`,
      where the right-hand side is of type `np.generic`, to
      `self.dtype = str(np.dtype(dtype))`, where the right-hand
      side is a string that satisfies:
      
      `self.dtype == str(np.dtype(self.dtype))`
      
      This doesn't change the behavior of `np.array(..., dtype=self.dtype)`
      etc.
      ca089790
    • Ricardo Vieira's avatar
      Update numpy deprecated imports · e036caf9
      Ricardo Vieira 提交于
      - replaced np.AxisError with np.exceptions.AxisError
      - the `numpy.core` submodule has been renamed to `numpy._core`
      - some parts of `numpy.core` have been moved to `numpy.lib.array_utils`
      
      Except for `AxisError`, the updated imports are conditional on
      the version of numpy, so the imports should work for numpy >= 1.26.
      
      The conditional imports have been added to `npy_2_compat.py`, so the
      imports elsewhere are unconditonal.
      e036caf9
  2. 17 2月, 2025 13 次提交
  3. 13 2月, 2025 3 次提交
  4. 12 2月, 2025 6 次提交
  5. 10 2月, 2025 1 次提交
  6. 06 2月, 2025 1 次提交
  7. 04 2月, 2025 4 次提交
  8. 03 2月, 2025 2 次提交
  9. 01 2月, 2025 2 次提交
  10. 29 1月, 2025 6 次提交