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.1.tar.gz (2.3 kB view details)

Uploaded Source

File details

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

File metadata

  • Download URL: redistensor-0.0.1.tar.gz
  • Upload date:
  • Size: 2.3 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.1.tar.gz
Algorithm Hash digest
SHA256 249593c8ed62a6ad11d6e43fca202b5ca30a731fd0caa21ca4beb60974c18b9c
MD5 98430fa8b0627826be710661f4af4f2c
BLAKE2b-256 b53ce09d3c99747a3b2f443a9c1e9c2fe40558f7afd0370eea1043e9015ceee0

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