MCPcopy Create free account
hub / github.com/zai-org/CodeGeeX / copy_tensor_model_parallel_attributes

Function copy_tensor_model_parallel_attributes

codegeex/megatron/mpu/layers.py:74–80  ·  view source on GitHub ↗
(destination_tensor, source_tensor)

Source from the content-addressed store, hash-verified

72
73
74def copy_tensor_model_parallel_attributes(destination_tensor, source_tensor):
75 def maybe_copy(attribute):
76 if hasattr(source_tensor, attribute):
77 setattr(destination_tensor, attribute, getattr(source_tensor, attribute))
78
79 for attribute in _MODEL_PARALLEL_ATTRIBUTE_DEFAULTS:
80 maybe_copy(attribute)
81
82
83def _initialize_affine_weight_gpu(weight, init_method, partition_dim, stride=1):

Callers

nothing calls this directly

Calls 1

maybe_copyFunction · 0.85

Tested by

no test coverage detected