Ejemplo n.º 1
0
 def get_state_batches(self) -> _k2.RaggedInt:
     '''Get (and compute if necessary) cached property self.state_batches.
        For use by internal k2 code.  Used in many algorithms.'''
     if hasattr(self, 'state_batches') is False:
         state_batches = _k2._get_state_batches(self.arcs, transpose=True)
         self._update_cache('state_batches', state_batches)
     return self.state_batches
Ejemplo n.º 2
0
Archivo: fsa.py Proyecto: ts0923/k2
 def get_state_batches(self) -> _k2.RaggedInt:
     '''Get (and compute if necessary) cached property self.state_batches.
        For use by internal k2 code.  Used in many algorithms.'''
     name, cache = 'state_batches', self._cache
     if name not in cache:
         cache[name] = _k2._get_state_batches(self.arcs, transpose=True)
     return cache[name]
Ejemplo n.º 3
0
 def update_state_batches(self) -> _k2.RaggedInt:
     if hasattr(self, 'state_batches') is False:
         state_batches = _k2._get_state_batches(self.arcs, transpose=True)
         self._update_cache('state_batches', state_batches)
     return self.state_batches