MCPcopy Create free account
hub / github.com/DSL-Lab/StreamSplat / add_prefix

Function add_prefix

encoders/dinov2/hub/depth/encoder_decoder.py:15–31  ·  view source on GitHub ↗

Add prefix for dict. Args: inputs (dict): The input dict with str keys. prefix (str): The prefix to add. Returns: dict: The dict with keys updated with ``prefix``.

(inputs, prefix)

Source from the content-addressed store, hash-verified

13
14
15def add_prefix(inputs, prefix):
16 """Add prefix for dict.
17
18 Args:
19 inputs (dict): The input dict with str keys.
20 prefix (str): The prefix to add.
21
22 Returns:
23
24 dict: The dict with keys updated with ``prefix``.
25 """
26
27 outputs = dict()
28 for name, value in inputs.items():
29 outputs[f"{prefix}.{name}"] = value
30
31 return outputs
32
33
34class DepthEncoderDecoder(nn.Module):

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected