def get_entering_arc_batches(self) -> _k2.RaggedInt: '''Get (and compute if necessary) cached property self.entering_arc_batches For use by internal k2 code, used in many algorithms.''' name, cache = 'entering_arc_batches', self._cache if name not in cache: cache[name] = _k2._get_entering_arc_index_batches( self.arcs, incoming_arcs=self.get_incoming_arcs(), state_batches=self.get_state_batches()) return cache[name]
def update_entering_arc_batches(self) -> _k2.RaggedInt: if hasattr(self, 'entering_arc_batches') is False: incoming_arcs = self.update_incoming_arcs() state_batches = self.update_state_batches() entering_arc_batches = _k2._get_entering_arc_index_batches( self.arcs, incoming_arcs=incoming_arcs, state_batches=state_batches) self._update_cache('entering_arc_batches', entering_arc_batches) return self.entering_arc_batches
def get_entering_arc_batches(self) -> _k2.RaggedInt: '''Get (and compute if necessary) cached property self.entering_arc_batches For use by internal k2 code, used in many algorithms.''' if hasattr(self, 'entering_arc_batches') is False: incoming_arcs = self.get_incoming_arcs() state_batches = self.get_state_batches() entering_arc_batches = _k2._get_entering_arc_index_batches( self.arcs, incoming_arcs=incoming_arcs, state_batches=state_batches) self._update_cache('entering_arc_batches', entering_arc_batches) return self.entering_arc_batches