MCPcopy Create free account
hub / github.com/Project-MONAI/MONAI / _strip_bias_field

Function _strip_bias_field

tests/networks/layers/test_get_layers.py:22–31  ·  view source on GitHub ↗

Strip the optional PyTorch >= 2.13 ``, bias=True|False`` repr fragment. Args: text: Layer string representation to normalize. Returns: The representation with any ``, bias=True|False`` removed.

(text: str)

Source from the content-addressed store, hash-verified

20
21
22def _strip_bias_field(text: str) -> str:
23 """Strip the optional PyTorch >= 2.13 ``, bias=True|False`` repr fragment.
24
25 Args:
26 text: Layer string representation to normalize.
27
28 Returns:
29 The representation with any ``, bias=True|False`` removed.
30 """
31 return re.sub(r",\s*bias=(?:True|False)", "", text)
32
33
34TEST_CASE_NORM = [

Callers 1

test_norm_layerMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…