MCPcopy Create free account
hub / github.com/InternRobotics/G2VLM / modulate

Function modulate

eval_code/recons/models/vggt/heads/camera_head.py:157–162  ·  view source on GitHub ↗

Modulate the input tensor using scaling and shifting parameters.

(x: torch.Tensor, shift: torch.Tensor, scale: torch.Tensor)

Source from the content-addressed store, hash-verified

155
156
157def modulate(x: torch.Tensor, shift: torch.Tensor, scale: torch.Tensor) -> torch.Tensor:
158 """
159 Modulate the input tensor using scaling and shifting parameters.
160 """
161 # modified from https://github.com/facebookresearch/DiT/blob/796c29e532f47bba17c5b9c5eb39b9354b8b7c64/models.py#L19
162 return x * (1 + scale) + shift

Callers 1

trunk_fnMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected