MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / TF_SetAttrTensorList

Function TF_SetAttrTensorList

tensorflow/c/c_api.cc:989–1003  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

987}
988
989void TF_SetAttrTensorList(TF_OperationDescription* desc, const char* attr_name,
990 TF_Tensor* const* values, int num_values,
991 TF_Status* status) {
992 status->status = Status::OK();
993 std::vector<Tensor> t;
994 t.reserve(num_values);
995
996 for (int i = 0; i < num_values && TF_GetCode(status) == TF_OK; ++i) {
997 Tensor v;
998 status->status = TF_TensorToTensor(values[i], &v);
999 t.emplace_back(v);
1000 }
1001
1002 if (TF_GetCode(status) == TF_OK) desc->node_builder.Attr(attr_name, t);
1003}
1004
1005void TF_SetAttrValueProto(TF_OperationDescription* desc, const char* attr_name,
1006 const void* proto, size_t proto_len,

Calls 5

TF_GetCodeFunction · 0.85
TF_TensorToTensorFunction · 0.85
reserveMethod · 0.45
emplace_backMethod · 0.45
AttrMethod · 0.45

Tested by 1

TEST_FFunction · 0.68