MCPcopy Create free account
hub / github.com/TencentARC/BrushNet / find_tensor_attributes

Function find_tensor_attributes

src/diffusers/models/modeling_utils.py:70–72  ·  view source on GitHub ↗
(module: torch.nn.Module)

Source from the content-addressed store, hash-verified

68 # For torch.nn.DataParallel compatibility in PyTorch 1.5
69
70 def find_tensor_attributes(module: torch.nn.Module) -> List[Tuple[str, Tensor]]:
71 tuples = [(k, v) for k, v in module.__dict__.items() if torch.is_tensor(v)]
72 return tuples
73
74 gen = parameter._named_members(get_members_fn=find_tensor_attributes)
75 first_tuple = next(gen)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected