Skip to content
fn

grad_slot_buffer

int grad_slot_buffer(const ErrorBuilder & err, const TensorImpl & g)

g's values as a buffer read from its first byte in row-major order — the form a gradient slot holds. A CPU view answers storage() with a packed copy of the elements it reads; a Metal tensor's array is its elements, unless it is a window at an offset or with strides into another tensor's array, which only the private _make_view builds and which has no such buffer to hand over.

Raises

NotImplementedError
g is such a Metal window.