diff --git a/Source/CNTKv2LibraryDll/proto/onnx/ONNXToCNTK.cpp b/Source/CNTKv2LibraryDll/proto/onnx/ONNXToCNTK.cpp index 6d8ada0ae..3a31d0229 100644 --- a/Source/CNTKv2LibraryDll/proto/onnx/ONNXToCNTK.cpp +++ b/Source/CNTKv2LibraryDll/proto/onnx/ONNXToCNTK.cpp @@ -2353,12 +2353,14 @@ FunctionPtr ONNXToCNTKHelper::CreateFunction(const Node *node, const std::vector } else if (onnxOpName == "Max") { - FunctionPtr cntkFunction = ElementMax(inputs[0], inputs[1], ToFixedWStringFromMultiByte(node->Name())); + // TODO: Support more than 2 inputs. + FunctionPtr cntkFunction = ElementMax(inputs[0], inputs.size() > 1 ? inputs[1] : inputs[0], ToFixedWStringFromMultiByte(node->Name())); return cntkFunction; } else if (onnxOpName == "Min") { - FunctionPtr cntkFunction = ElementMin(inputs[0], inputs[1], ToFixedWStringFromMultiByte(node->Name())); + // TODO: Support more than 2 inputs. + FunctionPtr cntkFunction = ElementMin(inputs[0], inputs.size() > 1 ? inputs[1] : inputs[0], ToFixedWStringFromMultiByte(node->Name())); return cntkFunction; } else if (onnxOpName == "Sum") diff --git a/bindings/python/onnx_cntk/tests/onnx_backend_test.py b/bindings/python/onnx_cntk/tests/onnx_backend_test.py index 7b64cb9d7..9c4a33400 100644 --- a/bindings/python/onnx_cntk/tests/onnx_backend_test.py +++ b/bindings/python/onnx_cntk/tests/onnx_backend_test.py @@ -35,10 +35,6 @@ skip_models = [ skip_ops = [ # These tests crash and prevent tests after them from running. - 'test_max_one_input_cpu', - 'test_max_one_input_cuda', - 'test_min_one_input_cpu', - 'test_min_one_input_cuda', 'test_reshape_extended_dims_cpu', 'test_reshape_extended_dims_cuda', 'test_reshape_negative_dim_cpu',