Skip to main content

tencat is a python package that offers functionality to slice sparse tensors

Project description

Tencat is a Python library that offers basic sparse tensor slicing capabilities.

Installation

Use the package manager pip to install tencat.

pip install tencat

Usage

Tencat implements the coordinate format in SparseTensor using a (N,d) ndarray as indices, a (N,) ndarray as values and an optional d length size tuple.

from tencat import tencat as tc

nnz = 100 # Number of nonzero elements
ndim = 4 # Number of dimensions

indices = np.randint(100,(nnz,ndim)) # Create random indices
values = np.random.rand(nnz,) # create random elements

dense_shape = np.amax(indices,axis=0) + np.random.randint(5,size=(ndim,))

sparse_tc = tc.SparseTensor(indices,values,dense_shape)

sliced_tc = sparse_tc.slice((1,5,6,4),(3,2,10,5))

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tencat-0.3.tar.gz (3.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tencat-0.3-py3-none-any.whl (4.0 kB view details)

Uploaded Python 3

File details

Details for the file tencat-0.3.tar.gz.

File metadata

  • Download URL: tencat-0.3.tar.gz
  • Upload date:
  • Size: 3.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2.post20191203 requests-toolbelt/0.9.1 tqdm/4.40.2 CPython/3.6.9

File hashes

Hashes for tencat-0.3.tar.gz
Algorithm Hash digest
SHA256 47c028e6f6c31d91eb2015de0991d15f1106174a57cf8603827c9a00071f5d80
MD5 2c8072be2953d8340a72c03dbed123c2
BLAKE2b-256 6f2ba9e3ea3cf01f9c22b22291426f89f10911eaea966366430c66c5ace1051b

See more details on using hashes here.

File details

Details for the file tencat-0.3-py3-none-any.whl.

File metadata

  • Download URL: tencat-0.3-py3-none-any.whl
  • Upload date:
  • Size: 4.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2.post20191203 requests-toolbelt/0.9.1 tqdm/4.40.2 CPython/3.6.9

File hashes

Hashes for tencat-0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 d5f3af9d25da89faf6a00e642a51968f4c3465db362381b2df35654d295a77ed
MD5 f672c93a077980fdcbdae54501b38dce
BLAKE2b-256 ad0998d0727532c320fa063f9aef0fc000d24eb0b805317fe1695bcad3dccab7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page