MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / is_reachable

Method is_reachable

tools/low_precision_optimize/simple_graph.py:227–244  ·  view source on GitHub ↗

Check if any nodes with index in `target_idx` can be reached from `src_idx` node. Parameters ---------- src_idx : int Index of source node. target_idx : Set[int] Indexes of target nodes. Returns ------- bool

(self, src_idx: int, target_idx: Set[int])

Source from the content-addressed store, hash-verified

225 return ordered
226
227 def is_reachable(self, src_idx: int, target_idx: Set[int]) -> bool:
228 """Check if any nodes with index in `target_idx` can be reached from `src_idx` node.
229
230 Parameters
231 ----------
232 src_idx : int
233 Index of source node.
234 target_idx : Set[int]
235 Indexes of target nodes.
236
237 Returns
238 -------
239 bool
240 True if any node in `target_idx` is reachable from source node.
241 """
242 if self.get_reachable(target_idx, src_idx):
243 return True
244 return False
245
246 def get_reachable(
247 self, target_idx: Set[int], start_at: Optional[int] = None

Callers

nothing calls this directly

Calls 1

get_reachableMethod · 0.95

Tested by

no test coverage detected