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

Uploaded Source

File details

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

File metadata

  • Download URL: redistensor-0.0.4.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.4.tar.gz
Algorithm Hash digest
SHA256 dcf5c94fbf0335a13835ef5d1e2b4a864d2999b61681a36b0b565d7ebe496be6
MD5 6f862e287f51886507cb51d0a30a39b7
BLAKE2b-256 a72df738266f377fad285e6cc0042513969633be8c5d92befea43724505b0bb4

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