warp.fem.Temporary#
- warp.fem.Temporary[source]#
Temporary array borrowed from a
TemporaryStore.The array will be automatically returned to the temporary pool for reuse upon destruction of this object, unless the temporary is explicitly detached from the pool using
detach(). The temporary may also be explicitly returned to the pool before destruction usingrelease().Temporaryis an alias ofwarp.array. Borrowed arrays use a custom deleter, and get thedetach()andrelease()methods at borrow time.Methods
assign(src)Wrap
srcin anwarp.arrayif it is not already one and copy the contents toself.contiguous()Return a contiguous array with this array's data.
cptr()Return a ctypes cast of the array address.
fill_(value)Set all array entries to value
flatten()Return a zero-copy view of the array collapsed to 1-D.
ipc_handle()Return an IPC handle of the array as a 64-byte
bytesobjectlist()Return a flattened list of items in the array as a Python list.
mark_init()Reset this array's read flag.
mark_read()Mark this array as having been read from in a kernel or recorded function on the tape.
mark_write(**kwargs)Warn if this array is written to after it has been read from in a recorded launch.
numpy(*[, _suppress_bfloat16_warning])Convert the array to a
numpy.ndarray(aliasing memory through the array interface protocol) If the array is on the GPU, a synchronous device-to-host copy (on the CUDA default stream) will be automatically performed to ensure that any outstanding work is completed.reshape(shape)Return a reshaped array.
to(device[, requires_grad])Return a Warp array with this array's data moved to the specified device, no-op if already on device.
transpose([axes])Return a zero-copy view of the array with axes transposed.
view(dtype)Return a zero-copy view of this array's memory with a different data type.
zero_()Zero out the array entries.
Attributes
gradArray that accumulates gradients for this array during the backward pass, or
None.memory_kindObserved memory kind backing this array.
requires_gradWhether gradients are tracked for this array.
retain_gradWhether the backward pass preserves this array's gradient instead of zeroing it.
varsalias of
array