Files
candle/candle-pyo3
Lukas Kreussel c05c0a8213 PyO3: Add equal and __richcmp__ to candle.Tensor (#1099)
* add `equal` to tensor

* add `__richcmp__` support  for tensors and scalars

* typo

* more typos

* Add `abs` + `candle.testing`

* remove duplicated `broadcast_shape_binary_op`

* `candle.i16` => `candle.i64`

* `tensor.nelements` -> `tensor.nelement`

* Cleanup `abs`
2023-10-30 15:17:28 +00:00
..
2023-08-05 14:53:57 +01:00
2023-10-29 15:41:44 +00:00
2023-10-29 15:41:44 +00:00

Installation

From the candle-pyo3 directory, enable a virtual env where you will want the candle package to be installed then run.

maturin develop -r 
python test.py

Generating Stub Files for Type Hinting

For type hinting support, the candle-pyo3 package requires *.pyi files. You can automatically generate these files using the stub.py script.

Steps:

  1. Install the package using maturin.
  2. Generate the stub files by running:
    python stub.py
    

Validation:

To ensure that the stub files match the current implementation, execute:

python stub.py --check