Skip to main content

using redis to store tensor data

Project description

save numpy tensor using redis

prepare

install redis-server

using

    from redistensor import RedisTensor as rt
    import numpy as np

    host = "localhost"
    port = 6379
    password = ""
    r = rt(host, port, password)
    
    # save one tensor
    x = np.random.randn(2,3).astype(np.float32)
    print(x)

    r.set('x_1', x)

    # get one tensor
    y = r.get('x_1')
    print(y)
    
    # redis tensor name list
    names = r.names()

    for name in names:
        print(name)

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

redistensor-0.0.5.tar.gz (2.6 kB view details)

Uploaded Source

File details

Details for the file redistensor-0.0.5.tar.gz.

File metadata

  • Download URL: redistensor-0.0.5.tar.gz
  • Upload date:
  • Size: 2.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.5

File hashes

Hashes for redistensor-0.0.5.tar.gz
Algorithm Hash digest
SHA256 c20eefd576b88c1f7cb013a786506db43364246810b89a9b31ee7b1726fd3bcf
MD5 780e0129dc6c635f2bab9f9cf312910b
BLAKE2b-256 24b33c143ec20d26cbd990d7db1eeebfa6620251301305a0d590a67f29b74260

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