MCPcopy Create free account
hub / github.com/SooLab/CGFormer / find_tensor_attributes

Method find_tensor_attributes

bert/modeling_utils.py:136–138  ·  view source on GitHub ↗
(module: nn.Module)

Source from the content-addressed store, hash-verified

134 # For nn.DataParallel compatibility in PyTorch 1.5
135
136 def find_tensor_attributes(module: nn.Module) -> List[Tuple[str, Tensor]]:
137 tuples = [(k, v) for k, v in module.__dict__.items() if torch.is_tensor(v)]
138 return tuples
139
140 gen = self._named_members(get_members_fn=find_tensor_attributes)
141 first_tuple = next(gen)

Callers

nothing calls this directly

Calls 1

itemsMethod · 0.80

Tested by

no test coverage detected