fn
as_strided_op
int as_strided_op(const int & a, const int & size, const int & stride, int storage_offset)Python wrappers
Public Python APIs implemented by this engine symbol.View a's storage through size and stride from storage_offset, all in elements, as the reference's as_strided does: the offset counts from the storage's start, and a negative one means a's own. On the CPU the result is a view sharing a's buffer; on metal, where a tensor owns a packed buffer, it is a copy of the elements it names.
Raises when size and stride differ in length, an entry is negative,
or the view reaches past the storage. A gradient also needs every position
to be one of a's own elements, laid out contiguously.