Re-calculate module's repeat number of a block based on depth coefficient multiplier. Args: repeats: number of original repeats. depth_coefficient: depth coefficient for model. Returns: new repeat: new number of repeat after calculating.
(repeats: int, depth_coefficient: float | None)
| 899 | |
| 900 | |
| 901 | def _round_repeats(repeats: int, depth_coefficient: float | None) -> int: |
| 902 | """ |
| 903 | Re-calculate module's repeat number of a block based on depth coefficient multiplier. |
| 904 | |
| 905 | Args: |
| 906 | repeats: number of original repeats. |
| 907 | depth_coefficient: depth coefficient for model. |
| 908 | |
| 909 | Returns: |
| 910 | new repeat: new number of repeat after calculating. |
| 911 | """ |
| 912 | if not depth_coefficient: |
| 913 | return repeats |
| 914 | |
| 915 | # follow the formula transferred from official TensorFlow impl. |
| 916 | return int(math.ceil(depth_coefficient * repeats)) |
| 917 | |
| 918 | |
| 919 | def _calculate_output_image_size(input_image_size: list[int], stride: int | tuple[int]): |
no outgoing calls
no test coverage detected
searching dependent graphs…