rn
- odl.rn(shape, dtype=None, impl='numpy', device='cpu', **kwargs)
Return a space of real tensors.
Parameters
- shapepositive int or sequence of positive ints
Number of entries per axis for elements in this space. A single integer results in a space with 1 axis.
- dtype (str)optional
Data type of each element. See REAL_DTYPES in
odl.core.util.utility.pyfor available options. Defaults to float64- impl (str)str, optional
Impmlementation back-end for the space. See the constant TENSOR_SPACE_IMPLS for available backends options.
- kwargs :
Extra keyword arguments passed to the space constructor.
Returns
real_space :
TensorSpaceExamples
Space of real 3-tuples with
float32entries:>>> odl.rn(3, dtype='float32') rn(3, 'float32')
Real 2x3 tensors with
float32entries:>>> odl.rn((2, 3), dtype='float32') rn((2, 3), 'float32')
The default data type is float64
>>> ts = odl.rn((2, 3)) >>> ts rn((2, 3)) >>> ts.dtype dtype('float64')
See Also
tensor_space : Space of tensors with arbitrary scalar data type. cn : Complex tensor space.