docsapi referencedarkforest-core-tensor-clone_deep
API Referencecrate: darkforest-coresince v0.1.0-alpha

clone_deep

Allocates a new buffer and deeply copies all tensor elements.

clone_deep

darkforest-core module: tensor since v0.1.0-alpha

Signature

rust
pub fn clone_deep<T: Element, D: Device>(t: &Tensor<T, D>) -> Tensor<T, D>

Overview

Allocates a new buffer and deeply copies all tensor elements.

Invariants & Design Principles

  • Invariant: Adheres strictly to Dark Forest 64-byte alignment and strided memory invariants.
  • Invariant: Verified via unit tests, Miri memory model, and PyTorch cross-checks.

Usage Example

rust
// Example calling clone_deep
let _res = darkforest_core::tensor::clone_deep();

Related Components