semvec/pypi-packages huggingface dataset:
slicemap 1.2.0
Tiny dict-like structure with key slicing.
License: MIT
Requires Python: >=3.7

# Python Slice Map

[//]: # (To get badges go to https://shields.io/ and use https://pypi.org/pypi/slicemap/json as data url. Query fields using dot as the separator.)

[![PyPi version](https://img.shields.io/badge/dynamic/json?label=latest&query=info.version&url=https%3A%2F%2Fpypi.org%2Fpypi%2Fslicemap%2Fjson)](https://pypi.org/project/slicemap)
[![PyPI license](https://img.shields.io/badge/dynamic/json?label=license&query=info.license&url=https%3A%2F%2Fpypi.org%2Fpypi%2Fslicemap%2Fjson)](https://github.com/sjmikler/slicemap/blob/main/LICENSE.txt)

Slicemap is a MIT licensed library introducing a useful, dictionary-like data structure,
similar to normal Python dict, but instead of setting values key by key, you set entire slices.

Features:

* Implemented entirely in Python
* Has only one dependency: [sortedcontainers](https://grantjenks.com/docs/sortedcontainers/)
* Is efficient, it has ``O(log(n))`` time complexity for insertion and query
    * Adding new slices might make old ones become redundant
    * ``n`` correspondes to the maximal number of slices present in SliceMap at a time
* Makes life easier, see [applications](docs/applications.md)

## Example

```py
from slicemap import SliceMap
sm = SliceMap()
sm[-3:3] = 0.1
sm[6.5:] = "Hello, SliceMap"
print(sm[0])
print(sm[10])
```

```stdout
0.1
'Hello, SliceMap'
```

**See more examples in [Quick Start](docs/quick-start.md).**


## Installation

Install easily with pip:

```
pip install slicemap
```

## Links

* [Read Documentation](https://github.com/sjmikler/slicemap/tree/main/docs)
* [See on GitHub](https://github.com/gahaalt/slicemap/)
* [See on PyPI](https://pypi.org/project/slicemap/)
anygrad 0.0.4
A Tensor module that allows a deep learning framework to switch seamlessly between different engines.
License: MIT

<div align="center">
  
# 🚂 AnyGrad: Flexible Engine for Tensor and Neural Network.

[![Python Version](https://img.shields.io/badge/Python-3.10%2B-blue?logo=python)](https://www.python.org/)  [![PyPI Version](https://img.shields.io/pypi/v/anygrad?color=yellow&logo=pypi)](https://pypi.org/project/anygrad/)  


</div>

## Overview
AnyGrad is a simple tensor library that makes it easy to perform forward and backward passes. It uses a high-performance C++ backend together with a user-friendly Python frontend. You can change the backend easily and simply.

> Note: currently version `0.0.1` does not support any engine. 
But in the future, the integrations of engines like `numpy`, `pytorch` etc. will come and you can use them for anything from Tensor operation to high-level transformer training. 

## Installation
Install the library from PyPI:
```bash
pip install anygrad
```

If you'd like to work on the code:
```bash
git clone https://github.com/Ruhaan838/AnyGrad.git
./setup.sh
```

## Getting Started
### Creating a Tensor
Create tensors by importing the library and instantiating `Tensor`. By default, gradients are not tracked unless you enable them:
```python
import anygrad

# A tensor that does not calculate gradients
a = anygrad.Tensor([1, 2, 3])  

# A tensor with gradient tracking enabled
b = anygrad.Tensor([2, 3, 4], requires_grad=True)  

# A tensor with a specific data type (float64)
c = anygrad.Tensor([2, 3, 4], dtype=anygrad.float64)
```
> Other datatypes:<br>
anygrad.int32 <br>
anygrad.int64 <br>
anygrad.bool <br>

### Arithmetic Operations
#### Element-wise Operations
Perform calculations on tensors element by element:
```python
d = a + b         # addition
d = a * d         # multiplication
d = d / 10        # division
e = d - 10        # subtraction
```

#### Matrix Multiplication
You can multiply matrices in two ways:
```python
# Using the @ operator:
a = anygrad.ones((1, 2, 3), requires_grad=True)
b = anygrad.ones((2, 3, 4), requires_grad=True)
c = a @ b         # tensor of shape (2, 2, 4)

# Or using the function:
c = anygrad.matmul(a, b)
```

### Gradient Calculation
AnyGrad automatically computes gradients, which you can access after running the backward pass:
```python
a = anygrad.Tensor([1, 2, 3], requires_grad=True)
b = anygrad.Tensor([2, 3, 4], requires_grad=True)
c = a * b 
result = c.sum()
result.backward()

print(a.grad)
print(b.grad)
```

## Contributing
Contributions are welcome! Whether you want to improve performance or enhance the documentation, please open an issue or submit a pull request.

## License
This project is licensed under the terms outlined in the [LICENSE](LICENSE) file.