def __init__(self, *args, **kwargs): if not self._cached(): self.dtype = kwargs.get('dtype', np.float32) self._external = bool(kwargs.get('external', False)) self._onstack = bool(kwargs.get('onstack', False)) self._onheap = bool(kwargs.get('onheap', True)) # The memory scope of an Array must be well-defined assert single_or([self._external, self._onstack, self._onheap])
def update(self, dtype=None, shape=None, dimensions=None, onstack=None, onheap=None, external=None): self.dtype = dtype or self.dtype self.shape = shape or self.shape self.indices = dimensions or self.indices if any(i is not None for i in [external, onstack, onheap]): self._external = bool(external) self._onstack = bool(onstack) self._onheap = bool(onheap) assert single_or([self._external, self._onstack, self._onheap])
def __init__(self, *args, **kwargs): if not self._cached(): self.dtype = kwargs.get('dtype', np.float32) self._halo = kwargs.get('halo', tuple((0, 0) for i in range(self.ndim))) self._padding = kwargs.get('padding', tuple((0, 0) for i in range(self.ndim))) self._external = bool(kwargs.get('external', False)) self._onstack = bool(kwargs.get('onstack', False)) self._onheap = bool(kwargs.get('onheap', True)) # The memory scope of an Array must be well-defined assert single_or([self._external, self._onstack, self._onheap])
def __init__(self, *args, **kwargs): if not self._cached(): self.name = kwargs.get('name') self.shape = kwargs.get('shape') self.indices = kwargs.get('dimensions') self.dtype = kwargs.get('dtype', np.float32) self._external = bool(kwargs.get('external', False)) self._onstack = bool(kwargs.get('onstack', False)) self._onheap = bool(kwargs.get('onheap', True)) # The memory scope of a TensorFunction must be well-defined assert single_or([self._external, self._onstack, self._onheap])