MCPcopy Index your code
hub / github.com/facebookresearch/sam-3d-objects / tree_tensor_map

Function tree_tensor_map

sam3d_objects/data/utils.py:58–65  ·  view source on GitHub ↗
(fn, tree, *rest)

Source from the content-addressed store, hash-verified

56
57@staticmethod
58def tree_tensor_map(fn, tree, *rest):
59 return optree.tree_map(
60 fn,
61 tree,
62 *rest,
63 is_leaf=lambda x: isinstance(x, torch.Tensor),
64 none_is_leaf=False,
65 )
66
67
68def to_device(obj, device):

Callers 11

stepMethod · 0.90
stepMethod · 0.90
_generate_x0Method · 0.90
_generate_xtMethod · 0.90
_generate_targetMethod · 0.90
_tree_flattenMethod · 0.90
lossMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected