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

Function TFE_OpSetAttrShapeList

tensorflow/c/eager/c_api.cc:800–830  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

798}
799
800void TFE_OpSetAttrShapeList(TFE_Op* op, const char* attr_name,
801 const int64_t** dims, const int* num_dims,
802 int num_values, TF_Status* out_status) {
803 std::unique_ptr<tensorflow::TensorShapeProto[]> proto(
804 new tensorflow::TensorShapeProto[num_values]);
805 for (int i = 0; i < num_values; ++i) {
806 const auto num_dims_i = num_dims[i];
807
808 if (num_dims_i > tensorflow::TensorShape::MaxDimensions()) {
809 TF_SetStatus(out_status, TF_INVALID_ARGUMENT,
810 tensorflow::strings::StrCat(
811 "Value specified for `", attr_name, "` has ", num_dims_i,
812 " dimensions which is over the limit of ",
813 tensorflow::TensorShape::MaxDimensions(), ".")
814 .c_str());
815 return;
816 }
817 if (num_dims_i < 0) {
818 proto[i].set_unknown_rank(true);
819 } else {
820 const int64_t* dims_i = dims[i];
821 auto proto_i = &proto[i];
822 for (int d = 0; d < num_dims_i; ++d) {
823 proto_i->add_dim()->set_size(dims_i[d]);
824 }
825 }
826 }
827 op->operation.MutableAttrs()->Set(
828 attr_name, tensorflow::gtl::ArraySlice<tensorflow::TensorShapeProto>(
829 proto.get(), num_values));
830}
831
832void TFE_OpSetAttrFunctionList(TFE_Op* op, const char* attr_name,
833 const TFE_Op** value, int num_values) {

Callers 4

SetOpAttrListFunction · 0.85
SetOpAttrListDefaultFunction · 0.85
createTFEQueueFunction · 0.85

Calls 7

TF_SetStatusFunction · 0.85
c_strMethod · 0.80
MutableAttrsMethod · 0.80
StrCatFunction · 0.50
set_sizeMethod · 0.45
SetMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected