Home
last modified time | relevance | path

Searched refs:value_attr (Results 1 – 13 of 13) sorted by relevance

/external/tensorflow/tensorflow/compiler/mlir/quantization/tensorflow/passes/
Dutils.h71 auto value_attr = DenseFPElementsAttr::get(type, values); in CreateConstValue() local
72 return builder.create<TF::ConstOp>(loc, value_attr); in CreateConstValue()
94 DenseIntElementsAttr value_attr; in GetSplatValue() local
95 if (!matchPattern(value, m_Constant(&value_attr)) || in GetSplatValue()
96 !value_attr.isSplat()) { in GetSplatValue()
99 splat_value = value_attr.getSplatValue<T>(); in GetSplatValue()
103 DenseFPElementsAttr value_attr; in GetSplatValue() local
104 if (!matchPattern(value, m_Constant(&value_attr)) || !value_attr.isSplat()) { in GetSplatValue()
107 splat_value = value_attr.getSplatValue<T>(); in GetSplatValue()
/external/tensorflow/tensorflow/lite/toco/tensorflow_graph_matching/
Dresolve_svdf.cc64 const auto& value_attr = node->attr().at("value"); in FilterPartitionedConstNodes() local
65 const tensorflow::TensorProto& tensor = value_attr.tensor(); in FilterPartitionedConstNodes()
84 const auto& value_attr = node->attr().at("value"); in InferFilterRank() local
85 const tensorflow::TensorProto& tensor = value_attr.tensor(); in InferFilterRank()
191 const auto& value_attr = const_node_parts[i]->attr().at("value"); in MaybeMergeConstNodes() local
192 const tensorflow::TensorProto& tensor = value_attr.tensor(); in MaybeMergeConstNodes()
219 const auto& value_attr = const_node_parts[i]->attr().at("value"); in MaybeMergeConstNodes() local
220 const tensorflow::TensorProto& tensor = value_attr.tensor(); in MaybeMergeConstNodes()
/external/tensorflow/tensorflow/lite/toco/
Dimport_tensorflow_test.cc172 AttrValue value_attr; in BuildConstNode() local
173 SetAttrValue(t, &value_attr); in BuildConstNode()
174 (*node->mutable_attr())["value"] = value_attr; in BuildConstNode()
514 AttrValue value_attr; in NodeWithTensorContent() local
515 SetAttrValue(t, &value_attr); in NodeWithTensorContent()
516 (*node->mutable_attr())["value"] = value_attr; in NodeWithTensorContent()
680 AttrValue value_attr; in TEST() local
681 SetAttrValue(2, &value_attr); in TEST()
682 (*node.mutable_attr())["Nsparse"] = value_attr; in TEST()
688 AttrValue value_attr; in TEST() local
[all …]
/external/tensorflow/tensorflow/compiler/mlir/tfrt/transforms/
Dtf_to_tfrt_data.cc55 T ConstAttrToTypeAttr(ElementsAttr value_attr) { in ConstAttrToTypeAttr() argument
56 if (T type_attr = value_attr.dyn_cast<T>()) { in ConstAttrToTypeAttr()
58 } else if (auto v = value_attr.dyn_cast<SplatElementsAttr>()) { in ConstAttrToTypeAttr()
/external/tensorflow/tensorflow/compiler/mlir/lite/transforms/
Dprepare_quantize_dynamic_range.cc366 DenseFPElementsAttr value_attr = in convertToFloat16Constant() local
368 new_values.reserve(value_attr.getNumElements()); in convertToFloat16Constant()
373 for (auto value : value_attr.template getValues<float>()) { in convertToFloat16Constant()
/external/tensorflow/tensorflow/core/grappler/optimizers/
Dgeneric_layout_optimizer_transposer.cc607 const auto* value_attr = fanin_node_view->GetAttr(kAttrValue); in IsFaninPortDimsNIfConst() local
608 if (value_attr == nullptr) { in IsFaninPortDimsNIfConst()
612 if (!tensor.FromProto(value_attr->tensor())) { in IsFaninPortDimsNIfConst()
1509 const auto* value_attr = axis_node->GetAttr(kAttrValue); in IsReduceAxisSupported() local
1510 if (value_attr == nullptr) { in IsReduceAxisSupported()
1514 if (!tensor.FromProto(value_attr->tensor())) { in IsReduceAxisSupported()
2163 const auto* value_attr = regular_fanin_node->GetAttr(kAttrValue); in GetValueAttrFromConstInputNode() local
2164 if (value_attr == nullptr || value_attr->tensor().dtype() != DT_INT32) { in GetValueAttrFromConstInputNode()
2167 if (!tensor->FromProto(value_attr->tensor())) { in GetValueAttrFromConstInputNode()
Dgeneric_layout_optimizer_transposer_test.cc530 const auto* value_attr = const_perm_node->GetAttr("value"); in TEST_F() local
531 ASSERT_NE(value_attr, nullptr); in TEST_F()
534 ASSERT_TRUE(tensor.FromProto(value_attr->tensor())); in TEST_F()
/external/tensorflow/tensorflow/core/ir/
Dops.cc182 if (StringAttr value_attr = op->getAttrOfType<StringAttr>(keyword)) { local
183 assert(!value_attr.getValue().empty());
185 << value_attr.getValue() << "\")";
370 if (StringAttr value_attr = op.getAttrOfType<StringAttr>(keyword)) { in VerifyGenericTFGOperation() local
371 if (value_attr.getValue().empty()) { in VerifyGenericTFGOperation()
/external/tensorflow/tensorflow/core/transforms/constant_folding/
Dpass.cc81 ElementsAttr value_attr) { in CreateElementsAttrOfTypeValues() argument
86 tensor_shape, llvm::to_vector(value_attr.getValues<APInt>())); in CreateElementsAttrOfTypeValues()
89 tensor_shape, llvm::to_vector(value_attr.getValues<APFloat>())); in CreateElementsAttrOfTypeValues()
264 Attribute value_attr; in ReplaceOperationWithConstant() local
266 value_attr = builder.getIntegerAttr(dtype, constant_value); in ReplaceOperationWithConstant()
268 value_attr = builder.getFloatAttr(dtype, constant_value); in ReplaceOperationWithConstant()
271 RankedTensorType::get(res.getShape(), dtype), value_attr); in ReplaceOperationWithConstant()
3374 ElementsAttr value_attr = in matchAndRewrite() local
3376 if (!value_attr) return failure(); in matchAndRewrite()
3378 int output_idx = value_attr.getSplatValue<int>(); in matchAndRewrite()
/external/tensorflow/tensorflow/compiler/mlir/tensorflow/utils/
Dcompile_mlir_util.cc739 TF_ASSIGN_OR_RETURN(auto value_attr, in RewriteWithArgs()
743 mlir::UnknownLoc::get(module_op.getContext()), value_attr); in RewriteWithArgs()
/external/tensorflow/tensorflow/compiler/mlir/tensorflow/ir/
Dtf_ops_n_z.cc275 auto value_attr = const_op.value().dyn_cast<DenseIntElementsAttr>(); in fold() local
276 if (!value_attr || value_attr.getNumElements() != 1) return None; in fold()
278 auto value_ty = value_attr.getType(); in fold()
281 auto splat = value_attr.getSplatValue<IntegerAttr>(); in fold()
/external/tensorflow/tensorflow/python/
Dtfe_wrapper.cc146 tensorflow::Safe_PyObjectPtr value_attr( in InputTFE_InputTensorHandles() local
148 if (value_attr) { in InputTFE_InputTensorHandles()
150 (input_tensor_handles)[i] = EagerTensor_Handle(value_attr.get()); in InputTFE_InputTensorHandles()
/external/tensorflow/tensorflow/compiler/mlir/tensorflow/translate/
Dimport_model.cc3462 TF_ASSIGN_OR_RETURN(auto value_attr, ConvertTensor(value, &builder)); in CreateSavedModelIR()
3471 value_attr, in CreateSavedModelIR()
3486 TF_ASSIGN_OR_RETURN(auto value_attr, in CreateSavedModelIR()
3491 value_attr, in CreateSavedModelIR()
3492 /*type=*/mlir::TypeAttr::get(value_attr.getType()), in CreateSavedModelIR()