gradValue property

T get gradValue

Converts grad via shape and returns the value as T.

Implementation

T get gradValue {
  if (grad.isEmpty) {
    throw Exception("VRAM grad not synced to CPU. Call toCpu() first.");
  }
  return _unflatten(grad);
}