20#define SET_FEATURE(TYPE, _) \
21 void TensorflowSerDes::setFeature(const std::string &Name, \
23 std::string prefix = "feed_"; \
24 const int Index = CompiledModel->LookupArgIndex(prefix + Name); \
26 *reinterpret_cast<TYPE *>(CompiledModel->arg_data(Index)) = Value; \
32 const std::vector<int64_t> &Value) {
33 std::string prefix =
"feed_";
34 const int Index =
CompiledModel->LookupArgIndex(prefix + Name);
35 std::copy(Value.begin(), Value.end(),
40 const std::vector<float> &Value) {
41 std::string prefix =
"feed_";
42 const int Index =
CompiledModel->LookupArgIndex(prefix + Name);
43 std::copy(Value.begin(), Value.end(),
48 const std::vector<double> &Value) {
49 std::string prefix =
"feed_";
50 const int Index =
CompiledModel->LookupArgIndex(prefix + Name);
51 std::copy(Value.begin(), Value.end(),
56 const std::vector<std::string> &Value) {
57 std::string prefix =
"feed_";
58 const int Index =
CompiledModel->LookupArgIndex(prefix + Name);
59 std::copy(Value.begin(), Value.end(),
64 const std::vector<bool> &Value) {
65 std::string prefix =
"feed_";
66 const int Index =
CompiledModel->LookupArgIndex(prefix + Name);
67 std::copy(Value.begin(), Value.end(),
72 const std::vector<int> &Value) {
73 std::string prefix =
"feed_";
74 const int Index =
CompiledModel->LookupArgIndex(prefix + Name);
75 std::copy(Value.begin(), Value.end(),
#define SUPPORTED_TYPES(M)
#define SET_FEATURE(TYPE, _)
setFeature() is used to set the features of the data structure used for communication.
virtual void setFeature(const std::string &name, const google::protobuf::Message *value)
tensorflow::XlaCompiledCpuFunction * CompiledModel
Serialization/Deserialization to support TF AOT models.