Pre-release
This release is a pre-release and may not be stable for production use.
TensorFlow Nearest Neighbours Op
Given an embedding matrix EM, and batch of word embeddings x
find nearest embedding for each token x_ij in EM.
import tensorflow as tf
from tensorflow_nearest_neighbours import nearest_neighbours
tf.debugging.set_log_device_placement(True)
x = tf.random.uniform(shape=[8, 10, 32])
EM = tf.random.uniform(shape=[500, 32])
result = nearest_neighbours(x, EM)
print(result.shape)
Instalation
pip install tensorflow_nearest_neighbours
Release files for tensorflow-nearest-neighbours 0.0.1.dev1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distributions (wheels)
| File | Reset | |||
|---|---|---|---|---|
| tensorflow_nearest_neighbours-0.0.1.dev1-cp310-cp310-manylinux2014_x86_64.whl | CPython 3.10 | CPython 3.10 | Linux glibc 2.17+ x86-64 | Details |
| tensorflow_nearest_neighbours-0.0.1.dev1-cp310-cp310-macosx_13_0_arm64.whl | CPython 3.10 | CPython 3.10 | macOS 13.0+ ARM64 | Details |
| tensorflow_nearest_neighbours-0.0.1.dev1-cp39-cp39-manylinux2014_x86_64.whl | CPython 3.9 | CPython 3.9 | Linux glibc 2.17+ x86-64 | Details |
| tensorflow_nearest_neighbours-0.0.1.dev1-cp39-cp39-macosx_13_0_arm64.whl | CPython 3.9 | CPython 3.9 | macOS 13.0+ ARM64 | Details |
| tensorflow_nearest_neighbours-0.0.1.dev1-cp38-cp38-manylinux2014_x86_64.whl | CPython 3.8 | CPython 3.8 | Linux glibc 2.17+ x86-64 | Details |
| tensorflow_nearest_neighbours-0.0.1.dev1-cp38-cp38-macosx_13_0_arm64.whl | CPython 3.8 | CPython 3.8 | macOS 13.0+ ARM64 | Details |
Total release size: 874.1 kB
Release files / tensorflow_nearest_neighbours-0.0.1.dev1-cp310-cp310-manylinux2014_x86_64.whl
| Download URL | tensorflow_nearest_neighbours-0.0.1.dev1-cp310-cp310-manylinux2014_x86_64.whl |
|---|---|
| Size | 151.2 kB |
| Tags | CPython 3.10 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
c1302cc7d263839ba74f6335ea2e36a30afb7623d7c980fe2593829cb443715e
|
|
BLAKE2b-256 checksum How to use checksums |
744daf578f40e00beeaa2c97484360bee73b4591c71f4308c136156f0b749958
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.11.4
|
Release files / tensorflow_nearest_neighbours-0.0.1.dev1-cp310-cp310-macosx_13_0_arm64.whl
| Download URL | tensorflow_nearest_neighbours-0.0.1.dev1-cp310-cp310-macosx_13_0_arm64.whl |
|---|---|
| Size | 140.1 kB |
| Tags | CPython 3.10 macOS 13.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
6a5fce6606ddec93b4ca684c87bd2e18890b23004262251649123fa1a71e29e3
|
|
BLAKE2b-256 checksum How to use checksums |
f60744addf292b6b13141f005e37eda465a5d745ec5d96501b04008e5d51956c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.11
|
Release files / tensorflow_nearest_neighbours-0.0.1.dev1-cp39-cp39-manylinux2014_x86_64.whl
| Download URL | tensorflow_nearest_neighbours-0.0.1.dev1-cp39-cp39-manylinux2014_x86_64.whl |
|---|---|
| Size | 151.3 kB |
| Tags | CPython 3.9 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
4e3cb23154db6b383a09d5ec95c45b1ba444272226b60958b7bc20c36480350e
|
|
BLAKE2b-256 checksum How to use checksums |
06e73abad04d392a4176b5dd5ffddcff6cdae337771a9858477b8e877932d4ba
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.11.4
|
Release files / tensorflow_nearest_neighbours-0.0.1.dev1-cp39-cp39-macosx_13_0_arm64.whl
| Download URL | tensorflow_nearest_neighbours-0.0.1.dev1-cp39-cp39-macosx_13_0_arm64.whl |
|---|---|
| Size | 140.1 kB |
| Tags | CPython 3.9 macOS 13.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
53c5b05da94982ab72e973c269ac857b60b673d588b96e9b7c7c20e1f4777e6f
|
|
BLAKE2b-256 checksum How to use checksums |
04f123e72a4b3425b7bce52450bfa36c44fc3897d27abef7f95ece6adef6caab
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.11
|
Release files / tensorflow_nearest_neighbours-0.0.1.dev1-cp38-cp38-manylinux2014_x86_64.whl
| Download URL | tensorflow_nearest_neighbours-0.0.1.dev1-cp38-cp38-manylinux2014_x86_64.whl |
|---|---|
| Size | 151.3 kB |
| Tags | CPython 3.8 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
097d299f433150b80bdbfda3ff2f9c89656bf3fcdc4fab68bdf1c0e5a1e735d1
|
|
BLAKE2b-256 checksum How to use checksums |
f3f9dd7df15a7cf14378e6899bf1e81dce92cac63ed16843698721ca102808e3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.11.4
|
Release files / tensorflow_nearest_neighbours-0.0.1.dev1-cp38-cp38-macosx_13_0_arm64.whl
| Download URL | tensorflow_nearest_neighbours-0.0.1.dev1-cp38-cp38-macosx_13_0_arm64.whl |
|---|---|
| Size | 140.1 kB |
| Tags | CPython 3.8 macOS 13.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
87657b80fb45ed4d4627ae8fd9f085c8513eb39c9413976fbe3adfcd73a2749f
|
|
BLAKE2b-256 checksum How to use checksums |
c61479dc2f231928aa8bf453dbf4dcf664fa469ce2d87284f65a4244efeb0758
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.11
|