MCPcopy
hub / github.com/zju3dv/4K4D / add_batch

Function add_batch

easyvolcap/utils/data_utils.py:988–997  ·  view source on GitHub ↗
(batch)

Source from the content-addressed store, hash-verified

986
987
988def add_batch(batch) -> Union[torch.Tensor, np.ndarray]:
989 if isinstance(batch, (tuple, list)):
990 batch = [add_batch(b) for b in batch]
991 elif isinstance(batch, dict):
992 batch = dotdict({k: add_batch(v) for k, v in batch.items()})
993 elif isinstance(batch, (torch.Tensor, np.ndarray)): # numpy and others
994 batch = batch[None]
995 else:
996 batch = torch.as_tensor(batch)[None]
997 return batch
998
999
1000def add_iter(batch, iter, total) -> Union[torch.Tensor, np.ndarray]:

Callers 14

renderMethod · 0.90
renderMethod · 0.90
renderMethod · 0.90
renderMethod · 0.90
mainFunction · 0.90
mainFunction · 0.90
fuseFunction · 0.90
test_pytorch3d_renderingFunction · 0.90
test_pulsar_renderingFunction · 0.90

Calls 1

dotdictClass · 0.90