}
}
+/**
+ * @brief Determine padding type (SAME/VALID) from two numeric values - height and width padding.
+ * In general, knowing the input tensor shape is required to properly determine the padding type.
+ * Also, these two padding values might not map to SAME or VALID padding.
+ * @todo Change cout to logging call.
+ */
static ops::PaddingType getPadTypeFromTwoValues(unsigned int pad1, unsigned int pad2)
{
bool areBothPadsZero = pad1 == 0 && pad2 == 0;
- bool doPadsDiffer = pad1 != pad2;
if (areBothPadsZero)
{
return ops::PaddingType::Valid;
}
- else if (doPadsDiffer)
- {
- std::string pads = std::to_string(pad1) + ", " + std::to_string(pad2);
- throw PluginException(std::string("Unsupported pads: ") + pads);
- }
else
{
+ std::string pads = "[" + std::to_string(pad1) + ", " + std::to_string(pad2) + "]";
+ std::cout << "WARNING! Encountered padding " << pads
+ << ", assuming padding SAME, but it is not guaranteed to be correct." << std::endl;
return ops::PaddingType::Same;
}
}