module emote.memory.storage

Classes

class BaseStorage(dict):

A simple dictionary-based storage with support for a temporary workspace for sampled data.

Methods

def __init__(self, shape, dtype) -> None

Arguments:

  • shape
  • dtype
def get_empty_storage(self, count, length) -> None

A workspace that can be reused to skip reallocating the same numpy buffer each time the memory is sampled.

Will not work if the memory is sampled from multiple threads.

Arguments:

  • count
  • length
def sequence_length_transform(self, length) -> None
def post_import(self) -> None

class TagProxy:

Methods

def shape(self) -> None
def __init__(self, shape, dtype) -> None
def get_empty_storage(self, count, length) -> None

A workspace that can be reused to skip reallocating the same numpy buffer each time the memory is sampled.

Will not work if the memory is sampled from multiple threads.

Arguments:

  • count
  • length
def sequence_length_transform(self, length) -> None
def post_import(self) -> None
def shape(self) -> None

class VirtualStorage:

A virtual storage uses a simple storage to generate data.

Methods

def __init__(self, storage, shape, dtype) -> None

Arguments:

  • storage
  • shape
  • dtype
def shape(self) -> None
def sequence_length_transform(self, length) -> None
def get_empty_storage(self, count, length) -> None
def post_import(self) -> None

class LastWrapper:

Methods

def __init__(self, item) -> None
def shape(self) -> None
def __init__(self, item) -> None
def shape(self) -> None
def __init__(self, storage, shape, dtype, only_last) -> None
def sequence_length_transform(self, length) -> None
def with_only_last(storage, shape, dtype) -> None

class Wrapper:

Methods

def __init__(self, item, n) -> None
def shape(self) -> None
def __init__(self, storage, shape, dtype) -> None
def sequence_length_transform(self, length) -> None
def with_n(n) -> None

class MaskWrapper(Wrapper):

Methods

def __init__(self, length, shape, dtype) -> None
def shape(self) -> None
def __init__(self, storage, shape, dtype, mask) -> None
def as_mask(storage, shape, dtype) -> None