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

Method clone

colossalai/lazy/lazy_init.py:391–398  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

389 return self.to(device=device, non_blocking=non_blocking, memory_format=memory_format)
390
391 def clone(self) -> "LazyTensor":
392 def factory_fn(t: torch.Tensor, **kw):
393 # if self is materialized, return self
394 return t.clone()
395
396 target = LazyTensor(factory_fn, self, meta_data=self._meta_data)
397
398 return target
399
400 def detach(self) -> Tensor:
401 return self

Callers 15

test_overfitFunction · 0.45
packMethod · 0.45
forwardMethod · 0.45
_is_sequence_finishedFunction · 0.45
get_global_lossFunction · 0.45
torch_nn_normalizeFunction · 0.45
forwardMethod · 0.45
forwardMethod · 0.45
_init_chunksMethod · 0.45
collect_statesMethod · 0.45

Calls 1

LazyTensorClass · 0.85

Tested by 15

test_overfitFunction · 0.36
check_adam_kernelFunction · 0.36
exam_dist_adafactor_baseFunction · 0.36
run_fwd_bwd_iter_inputFunction · 0.36
assert_codegen_runFunction · 0.36
assert_codegen_runFunction · 0.36
assert_codegen_runFunction · 0.36
assert_codegen_runFunction · 0.36