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

Uploaded Source

File details

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

File metadata

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

File hashes

Hashes for redistensor-0.0.3.tar.gz
Algorithm Hash digest
SHA256 7b8439dd073b6bd09d249fb13bd52a08c11f15e03972b8d87f7c5ab120189161
MD5 f0df81f9c7793878b20e923d0ae7018c
BLAKE2b-256 33ebaee7337c4d72943b1f9c6c09a443f61c78f0adaeeb592db2d6af6eeba0ce

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