semvec/pypi-packages huggingface dataset:
torch-fn 1.0.0
A decorator for seamless PyTorch calculations (primarily on CUDA) from numpy.ndarray and pd.DataFrame.
License: MIT
Requires Python: >=3.6
Keywords: torch, GPU, numpy, pandas

![CI](https://github.com/ywatanabe1989/torch_fn/actions/workflows/pip_install.yml/badge.svg)
![CI](https://github.com/ywatanabe1989/torch_fn/actions/workflows/run_example.yml/badge.svg)

## Installation
``` bash
$ pip install torch_fn
```

## Usage

``` python
from torch_fn import torch_fn

import numpy as np
import torch.nn.functional as F

@torch_fn
def torch_softmax(*args, **kwargs):
    return F.softmax(*args, **kwargs)

def custom_print(x):
    print(type(x), x)

# Test the decorator with different input types
x = [1, 2, 3]
x_list = x
x_tensor = torch.tensor(x).float()
x_tensor_cuda = torch.tensor(x).float().cuda()
x_array = np.array(x)
x_df = pd.DataFrame({"col1": x})

custom_print(torch_softmax(x_list, dim=-1))
# /home/ywatanabe/proj/torch_fn/src/torch_fn/_torch_fn.py:57: UserWarning: Converted from  <class 'list'> to <class 'torch.Tensor'> (cuda:0)
#   warnings.warn(
# <class 'numpy.ndarray'> [0.09003057 0.24472848 0.6652409 ]

custom_print(torch_softmax(x_array, dim=-1))
# /home/ywatanabe/proj/torch_fn/src/torch_fn/_torch_fn.py:57: UserWarning: Converted from  <class 'numpy.ndarray'> to <class 'torch.Tensor'> (cuda:0)
#  warnings.warn(
# <class 'numpy.ndarray'> [0.09003057 0.24472848 0.6652409 ]

custom_print(torch_softmax(x_df, dim=-1))
# /home/ywatanabe/proj/torch_fn/src/torch_fn/_torch_fn.py:49: UserWarning: Converted from  <class 'pandas.core.frame.DataFrame'> to <class 'torch.Tensor'> (cuda:0)
#   warnings.warn(
# <class 'numpy.ndarray'> [0.09003057 0.24472848 0.6652409 ]

custom_print(torch_softmax(x_tensor, dim=-1))
# <class 'torch.Tensor'> tensor([0.0900, 0.2447, 0.6652])

custom_print(torch_softmax(x_tensor_cuda, dim=-1))
# <class 'torch.Tensor'> tensor([0.0900, 0.2447, 0.6652], device='cuda:0')
```
falcondale 0.2.4
Falcondale SDK
License: MIT
Requires Python: <3.12,>=3.10

![falcondale](https://github.com/stafford-computing/falcondale-sdk/blob/main/assets/falcondale_sdk_black.png?raw=true)

Falcondale Software Development Kit (SDK) is an open source project aiming to ease the barrier for Data Scientists entering the field of Quantum Machine Learning.

## Documentation

Official documentation can be found here: https://falcondale.readthedocs.io/en/latest/

To check the roadmap of the project, have a look to: https://github.com/orgs/stafford-computing/projects/2

## How to contribute

Check out the [wiki](https://github.com/stafford-computing/falcondale-sdk/wiki/How-to-contribute) for the latest convention on how to contribute.

## Authors

* [Stafford Computing LLC](https://www.staffordcomputing.com/)

## License

This project is licensed under the terms of the MIT license.