MCPcopy Create free account
hub / github.com/NVIDIA/cuda-quantum / formatKwargs

Function formatKwargs

python/runtime/cudaq/trace/py_trace.cpp:20–35  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

18#include <utility>
19
20static std::string formatKwargs(const nanobind::kwargs &kwargs) {
21 if (kwargs.size() == 0)
22 return {};
23 std::string out = " (args = {";
24 bool first = true;
25 for (const auto &item : kwargs) {
26 if (!first)
27 out += ", ";
28 first = false;
29 out += nanobind::cast<std::string>(item.first);
30 out += "=";
31 out += nanobind::cast<std::string>(nanobind::str(item.second));
32 }
33 out += "})";
34 return out;
35}
36
37namespace {
38class TraceSpan {

Callers 1

bindTraceMethod · 0.85

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected