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

Method _get

datasets/augmentv2.py:230–236  ·  view source on GitHub ↗

Retrieve a random tensor by name, sampling if necessary.

(name: str, tensor_fn, batch_dim: int = 0)

Source from the content-addressed store, hash-verified

228 rnd: Dict[str, torch.Tensor] = OrderedDict() # we will fill this
229
230 def _get(name: str, tensor_fn, batch_dim: int = 0):
231 """Retrieve a random tensor by name, sampling if necessary."""
232 if params is not None and name in params:
233 return params[name].transpose(0, batch_dim)
234 t = tensor_fn()
235 rnd[name] = t.transpose(0, batch_dim)
236 return t
237
238 labels: List[torch.Tensor] = [torch.zeros([images.shape[0], 0], device=device)]
239

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected