Converts grad via shape and returns the value as T.
T
T get gradValue { if (grad.isEmpty) { throw Exception("VRAM grad not synced to CPU. Call toCpu() first."); } return _unflatten(grad); }