MCPcopy Create free account
hub / github.com/NVIDIA/TensorRT / genFilenameSafeString

Function genFilenameSafeString

samples/common/sampleInference.cpp:1512–1524  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1510namespace {
1511
1512std::string genFilenameSafeString(std::string const& s)
1513{
1514 std::string res = s;
1515 static std::string const allowedSpecialChars{"._-,"};
1516 for (auto& c : res)
1517 {
1518 if (!isalnum(c) && allowedSpecialChars.find(c) == std::string::npos)
1519 {
1520 c = '_';
1521 }
1522 }
1523 return res;
1524}
1525
1526template <typename ContextType>
1527Dims getBindingDimensions(ContextType const& /*context*/, int32_t /*binding*/)

Callers 1

dumpRawBindingToFilesMethod · 0.85

Calls 1

findMethod · 0.45

Tested by

no test coverage detected