text
stringlengths
0
2.2M
json::value note;
note["type"] = type;
note["text"] = text;
(*this)["notes"].push_back(note);
}
json::value& Message::setData(const std::string& name)
{
return (*this)["data"][name] = name;
}
void Message::setData(const std::string& name, const char* data)
{
(*this)["data"][name] = data;
}
void Message::setData(const std::string& name, const std::string& data)
{
(*this)["data"][name] = data;
}
void Message::setData(const std::string& name, const json::value& data)
{
(*this)["data"][name] = data;
}
void Message::setData(const std::string& name, int data)
{
(*this)["data"][name] = data;
}
void Message::removeData(const std::string& name)
{
(*this)["data"].erase(name);
}
bool Message::hasData(const std::string& name)
{
auto& element = (*this)["data"];
return element.find(name) != element.end();
}
} // namespace smpl
} // namespace scy
/// @\}
#include <iostream>
#include <string>
/**
* The tracer.cpp generates a binary that accepts a TorchScript model or a
* Torch Mobile Model (with bytecode.pkl) which has at least 1 bundled
* input. This binary then feeds the bundled input(s) into the model
* and executes using the lite interpreter.
*
* Both root operators as well as called operators are recorded and saved
* into a YAML file (whose path is provided on the command line).
*
* Note: Root operators may include primary and other operators that
* are not invoked using the dispatcher, and hence they may not show
* up in the Traced Operator list.
*
*/
#include <ATen/core/dispatch/ObservedOperators.h>
#include <torch/csrc/autograd/grad_mode.h>
#include <torch/csrc/jit/mobile/import.h>
#include <torch/csrc/jit/mobile/model_tracer/KernelDTypeTracer.h>
#include <torch/csrc/jit/mobile/model_tracer/MobileModelRunner.h>
#include <torch/csrc/jit/mobile/model_tracer/OperatorCallTracer.h>
#include <torch/csrc/jit/mobile/model_tracer/TensorUtils.h>
#include <torch/csrc/jit/mobile/model_tracer/TracerRunner.h>
#include <torch/csrc/jit/mobile/module.h>
#include <torch/csrc/jit/mobile/parse_operators.h>
#include <torch/script.h>
typedef std::map<std::string, std::set<std::string>> kt_type;
C10_DEFINE_string(
model_input_path,
"",
"The path of the input model file (.ptl).");
C10_DEFINE_string(
build_yaml_path,
"",
"The path of the output YAML file containing traced operator information.");