NumpyTensor

class odl.space.npy_tensors.NumpyTensor(space, data)[source]

Bases: odl.space.base_tensors.Tensor

Representation of a NumpyTensorSpace element.

Attributes
T

This element’s transpose, i.e.

data

The numpy.ndarray representing the data of self.

data_ptr

A raw pointer to the data container of self.

dtype

Data type of each entry.

imag

Imaginary part of self.

impl

Name of the implementation back-end of this tensor.

itemsize

Size in bytes of one tensor entry.

nbytes

Total number of bytes in memory occupied by this tensor.

ndim

Number of axes (=dimensions) of this tensor.

real

Real part of self.

shape

Number of elements per axis.

size

Total number of entries.

space

Space to which this element belongs.

ufuncs

Access to Numpy style universal functions.

Methods

asarray(self[, out])

Extract the data of this array as a numpy.ndarray.

assign(self, other)

Assign the values of other to self.

astype(self, dtype)

Return a copy of this element with new dtype.

conj(self[, out])

Return the complex conjugate of self.

copy(self)

Return an identical (deep) copy of this tensor.

dist(self, other)

Return the distance of self to other.

divide(self, other[, out])

Return out = self / other.

inner(self, other)

Return the inner product of self and other.

lincomb(self, a, x1[, b, x2])

Implement self[:] = a * x1 + b * x2.

multiply(self, other[, out])

Return out = self * other.

norm(self)

Return the norm of this element.

set_zero(self)

Set this element to zero.

show(self[, title, method, indices, …])

Display the function graphically.

__init__(self, space, data)[source]

Initialize a new instance.