MCPcopy Create free account
hub / github.com/PaddlePaddle/FastDeploy / ensure_divisibility

Function ensure_divisibility

fastdeploy/model_executor/layers/utils.py:414–429  ·  view source on GitHub ↗

Ensure the numerator is divisible by the denominator. Args: numerator (int): The numerator. denominator (int): The denominator. Returns: None Raises: AssertionError: If the numerator cannot be evenly divided by the denominator, an assertion error i

(numerator, denominator)

Source from the content-addressed store, hash-verified

412
413
414def ensure_divisibility(numerator, denominator):
415 """
416 Ensure the numerator is divisible by the denominator.
417
418 Args:
419 numerator (int): The numerator.
420 denominator (int): The denominator.
421
422 Returns:
423 None
424
425 Raises:
426 AssertionError: If the numerator cannot be evenly divided by the denominator, an assertion error is raised.
427
428 """
429 assert numerator % denominator == 0, f"{numerator} is not divisible by {denominator}"
430
431
432def divide(numerator: int, denominator: int):

Callers 1

divideFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected