uninitVariable

create new variable with uninitialized array of shape on CPU/CUDA

uninitVariable
(
T
size_t dim
)
(
uint[dim] shape
,
bool requiresGrad = false
)

Examples

import std.stdio;
import numir;
import mir.ndslice;

auto x = numir.zeros(2, 3, 4).universal;
auto y = uninitVariable!float([2, 3, 4]);
assert(x.strides == y.strides);

Meta