TMaddox commented on a change in pull request #1234: URL: https://github.com/apache/systemds/pull/1234#discussion_r619851083
########## File path: src/main/python/systemds/operator/operation_node2.py ########## @@ -0,0 +1,527 @@ +# ------------------------------------------------------------- +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +# ------------------------------------------------------------- + +from typing import Union, Optional, Iterable, Dict, Sequence, Tuple, TYPE_CHECKING, List +from multiprocessing import Process + +import numpy as np +from py4j.java_gateway import JVMView, JavaObject + +from systemds.utils.consts import VALID_INPUT_TYPES, BINARY_OPERATIONS, VALID_ARITHMETIC_TYPES +from systemds.utils.helpers import create_params_string +from systemds.utils.converters import matrix_block_to_numpy +from systemds.script_building.script import DMLScript +from systemds.script_building.dag import OutputType, DAGNode + +if TYPE_CHECKING: + # to avoid cyclic dependencies during runtime + from systemds.context import SystemDSContext + + +class OperationNode2(DAGNode): + """A Node representing an operation in SystemDS + This is a temporary clone of OperationNode""" + shape: Optional[Tuple[int]] + _result_var: Optional[Union[float, np.array]] + _lineage_trace: Optional[str] + _script: Optional[DMLScript] + + def __init__(self, sds_context: 'SystemDSContext', operation: str, + unnamed_input_nodes: Iterable[VALID_INPUT_TYPES] = None, + named_input_nodes: Dict[str, VALID_INPUT_TYPES] = None, + outputs: List[Tuple[str, OutputType]] = [("_1", OutputType.MATRIX)], + is_python_local_data: bool = False, Review comment: My code makes OperationNode universal enough to handle all cases (multi and normal), there is no class "MultiNode" (for example) needed -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org