MCPcopy
hub / github.com/hpcaitech/ColossalAI / clone

Function clone

colossalai/pipeline/schedule/_utils.py:164–175  ·  view source on GitHub ↗

Call clone() on a tensor. Args: x (Any): Object to be called. Returns: Any: The cloned object.

(x: Any)

Source from the content-addressed store, hash-verified

162
163
164def clone(x: Any) -> Any:
165 """Call clone() on a tensor.
166
167 Args:
168 x (Any): Object to be called.
169
170 Returns:
171 Any: The cloned object.
172 """
173 if isinstance(x, torch.Tensor):
174 return x.clone()
175 return x
176
177
178def release_tensor_data(x: Any) -> Any:

Callers

nothing calls this directly

Calls 1

cloneMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…