def test_field_access_to_field_slice_variablek() -> None: field_access = FieldAccessFactory( offset=oir.VariableKOffset(k=oir.Literal(value="1", dtype=common.DataType.INT32)) ) field_slice = OirToNpir().visit(field_access) assert (field_slice.i_offset, field_slice.j_offset) == (0, 0) assert field_slice.k_offset.k.value == "1"
def visit_VariableKOffset(self, node: gtir.VariableKOffset) -> oir.VariableKOffset: return oir.VariableKOffset(k=self.visit(node.k))
def visit_VariableKOffset( self, node: gtir.VariableKOffset, **kwargs: Any ) -> oir.VariableKOffset: return oir.VariableKOffset(k=self.visit(node.k))