def get_incoming_arcs(self) -> _k2.RaggedInt: '''Get (and compute if necessary) cached property self.incoming_arcs For use by internal k2 code, relates to best-path''' if hasattr(self, 'incoming_arcs') is False: dest_states = self.get_dest_states() incoming_arcs = _k2._get_incoming_arcs(self.arcs, dest_states) self._update_cache('incoming_arcs', incoming_arcs) return self.incoming_arcs
def get_incoming_arcs(self) -> _k2.RaggedInt: '''Get (and compute if necessary) cached property self.incoming_arcs For use by internal k2 code, relates to best-path''' name, cache = 'incoming_arcs', self._cache if name not in cache: cache[name] = _k2._get_incoming_arcs(self.arcs, self.get_dest_states()) return cache[name]
def update_incoming_arcs(self) -> _k2.RaggedInt: if hasattr(self, 'incoming_arcs') is False: dest_states = self.update_dest_states() incoming_arcs = _k2._get_incoming_arcs(self.arcs, dest_states) self._update_cache('incoming_arcs', incoming_arcs) return self.incoming_arcs