示例#1
0
文件: fsa.py 项目: stormytrail/k2
 def get_dest_states(self) -> torch.Tensor:
     '''Get (and compute if necessary) cached property self.dest_states.
        For use by internal k2 code, relates to best-path.'''
     if hasattr(self, 'dest_states') is False:
         dest_states = _k2._get_dest_states(self.arcs, as_idx01=True)
         self._update_cache('dest_states', dest_states)
     return self.dest_states
示例#2
0
文件: fsa.py 项目: ts0923/k2
 def get_dest_states(self) -> torch.Tensor:
     '''Get (and compute if necessary) cached property self.dest_states.
        For use by internal k2 code, relates to best-path.'''
     name, cache = 'dest_states', self._cache
     if name not in cache:
         cache[name] = _k2._get_dest_states(self.arcs, as_idx01=True)
     return cache[name]
示例#3
0
 def update_dest_states(self) -> torch.Tensor:
     if hasattr(self, 'dest_states') is False:
         dest_states = _k2._get_dest_states(self.arcs, as_idx01=True)
         self._update_cache('dest_states', dest_states)
     return self.dest_states