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

Function divide

codegeex/megatron/mpu/utils.py:27–31  ·  view source on GitHub ↗

Ensure that numerator is divisible by the denominator and return the division value.

(numerator, denominator)

Source from the content-addressed store, hash-verified

25
26
27def divide(numerator, denominator):
28 """Ensure that numerator is divisible by the denominator and return
29 the division value."""
30 ensure_divisibility(numerator, denominator)
31 return numerator // denominator
32
33
34def split_tensor_along_last_dim(tensor, num_partitions, contiguous_split_chunks=False):

Callers 5

__init__Method · 0.85
__init__Method · 0.85

Calls 1

ensure_divisibilityFunction · 0.85

Tested by

no test coverage detected