def __init__(self, type_context: TypeContext): self._type_to_impl_tensor = [None] * type_context.get_type_count() for typ in type_context.get_all_types(): self._type_to_impl_tensor[typ.ind] = \ torch.LongTensor([impl.ind for impl in type_context.get_implementations(typ)])
def __init__(self, type_context: TypeContext): self.itos: typing.Sequence[Union[AInixType, AInixObject]] = \ np.array(list(type_context.get_all_objects()) + list(type_context.get_all_types())) self._finish_init()