Support one input case for Min/Max to pass ONNX backend tests.

This commit is contained in:
Sergii Dymchenko 2018-07-09 15:24:50 -07:00
Родитель dca867c2cb
Коммит 9ce967aa46
2 изменённых файлов: 4 добавлений и 6 удалений

Просмотреть файл

@ -2353,12 +2353,14 @@ FunctionPtr ONNXToCNTKHelper::CreateFunction(const Node *node, const std::vector
} }
else if (onnxOpName == "Max") 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; return cntkFunction;
} }
else if (onnxOpName == "Min") 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; return cntkFunction;
} }
else if (onnxOpName == "Sum") else if (onnxOpName == "Sum")

Просмотреть файл

@ -35,10 +35,6 @@ skip_models = [
skip_ops = [ skip_ops = [
# These tests crash and prevent tests after them from running. # 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_cpu',
'test_reshape_extended_dims_cuda', 'test_reshape_extended_dims_cuda',
'test_reshape_negative_dim_cpu', 'test_reshape_negative_dim_cpu',