ditto
auto o = ones!(float, [2, 2]); assert(!canBackward!(typeof(o))); assert(o.shape == [2, 2]); assert(o.value[0, 0] == 1); assert(o.value[0, 1] == 1); assert(o.value[1, 0] == 1); assert(o.value[1, 1] == 1);
ditto
auto o = ones!(float, [0, 2])(2); assert(!canBackward!(typeof(o))); assert(o.shape == [2, 2]); assert(o.value[0, 0] == 1); assert(o.value[0, 1] == 1); assert(o.value[1, 0] == 1); assert(o.value[1, 1] == 1);
ditto
auto o = ones!(float, [2, 3], UseGradient.yes); static assert(canBackward!(typeof(o)));