Home
last modified time | relevance | path

Searched refs:shape_attr (Results 1 – 21 of 21) sorted by relevance

/external/tensorflow/tensorflow/core/ops/
Dfunction_ops.cc37 const AttrValue* shape_attr = context->attrs().Find("_output_shapes"); in __anon5bd79b600102() local
38 if (shape_attr && shape_attr->has_list()) { in __anon5bd79b600102()
39 if (shape_attr->list().shape().empty()) { in __anon5bd79b600102()
42 shape_attr->DebugString()); in __anon5bd79b600102()
44 const TensorShapeProto& shape_proto = shape_attr->list().shape(0); in __anon5bd79b600102()
60 shape_attr = context->attrs().Find("_handle_shapes"); in __anon5bd79b600102()
63 if (!dtype_attr || !shape_attr) { in __anon5bd79b600102()
70 shape_attr->DebugString()); in __anon5bd79b600102()
72 if (shape_attr->list().shape().empty()) { in __anon5bd79b600102()
75 shape_attr->DebugString()); in __anon5bd79b600102()
[all …]
/external/tensorflow/tensorflow/core/tpu/ops/
Dhost_compute_ops.cc104 const AttrValue* shape_attr; in __anonc8f95cfc0402() local
105 TF_RETURN_IF_ERROR(c->attrs().Find("shape", &shape_attr)); in __anonc8f95cfc0402()
106 if (!shape_attr->has_shape()) { in __anonc8f95cfc0402()
112 c->MakeShapeFromShapeProto(shape_attr->shape(), &handle)); in __anonc8f95cfc0402()
/external/tensorflow/tensorflow/compiler/tf2xla/ops/
Dxla_ops.cc509 TensorShape shape_attr; in __anonbbc1c2d10402() local
510 TF_RETURN_IF_ERROR(c->GetAttr("shape", &shape_attr)); in __anonbbc1c2d10402()
512 TF_RETURN_IF_ERROR(c->MakeShapeFromTensorShape(shape_attr, &s)); in __anonbbc1c2d10402()
884 TensorShape shape_attr; in __anonbbc1c2d10d02() local
885 TF_RETURN_IF_ERROR(c->GetAttr("full_shape", &shape_attr)); in __anonbbc1c2d10d02()
887 TF_RETURN_IF_ERROR(c->MakeShapeFromTensorShape(shape_attr, &s)); in __anonbbc1c2d10d02()
/external/tensorflow/tensorflow/core/framework/
Dfunction_test.cc1507 AttrValue shape_attr; in TEST() local
1508 TensorShapeProto* shape_proto = shape_attr.mutable_list()->add_shape(); in TEST()
1514 (*arg_attrs.mutable_attr())["_output_shapes"] = std::move(shape_attr); in TEST()
1531 const auto& shape_attr = attr.list().shape(0); in TEST() local
1532 ASSERT_FALSE(shape_attr.unknown_rank()); in TEST()
1533 ASSERT_EQ(shape_attr.dim_size(), 4); in TEST()
1534 EXPECT_EQ(shape_attr.dim(0).size(), 2); in TEST()
1535 EXPECT_EQ(shape_attr.dim(1).size(), 4); in TEST()
1536 EXPECT_EQ(shape_attr.dim(2).size(), 6); in TEST()
1537 EXPECT_EQ(shape_attr.dim(3).size(), 8); in TEST()
/external/tensorflow/tensorflow/tools/graph_transforms/
Dfold_constants_test.cc145 tensorflow::AttrValue shape_attr; in TestPreserveOutputShapes() local
146 auto* shape_proto = shape_attr.mutable_list()->add_shape(); in TestPreserveOutputShapes()
153 placeholder.node()->AddAttr("_output_shapes", shape_attr); in TestPreserveOutputShapes()
/external/tensorflow/tensorflow/compiler/mlir/lite/transforms/
Doptimize.cc270 DenseIntElementsAttr shape_attr = in ShapeMatchesReduceWithKeepAxes() local
272 if (!axes_attr || !shape_attr) return false; in ShapeMatchesReduceWithKeepAxes()
274 if (shape_attr.getNumElements() != type.getRank()) return false; in ShapeMatchesReduceWithKeepAxes()
284 if (shape_attr.getValue<APInt>({i}) != 1) return false; in ShapeMatchesReduceWithKeepAxes()
286 if (shape_attr.getValue<APInt>({i}) != type_shape[i]) return false; in ShapeMatchesReduceWithKeepAxes()
Dprepare_tf.cc498 auto shape_attr = DenseElementsAttr::get(shape_type, result_shape_data); in legalizeFilter() local
499 auto shape = rewriter.create<TF::ConstOp>(loc, shape_type, shape_attr); in legalizeFilter()
564 auto shape_attr = DenseElementsAttr::get(shape_type, result_shape_data); in RewriteNewAxisMask() local
565 auto shape = rewriter.create<ConstantOp>(loc, shape_type, shape_attr); in RewriteNewAxisMask()
Dlower_static_tensor_list.cc374 SmallVector<Attribute, 4> shape_attr; in matchAndRewrite() local
376 shape_attr.push_back(rewriter.getI32IntegerAttr(dim)); in matchAndRewrite()
379 DenseElementsAttr::get(type, shape_attr); in matchAndRewrite()
/external/tensorflow/tensorflow/compiler/mlir/tensorflow/ir/
Dtf_ops.cc345 if (auto shape_attr = attr.dyn_cast<ShapeAttr>()) in printAttribute() local
346 PrintShapeAttr(shape_attr, os); in printAttribute()
Dtf_ops_n_z.cc590 DenseIntElementsAttr shape_attr; in GetReshapeOutputType() local
591 if (!matchPattern(shape, m_Constant(&shape_attr))) { in GetReshapeOutputType()
608 output_ty_shape.reserve(shape_attr.getNumElements()); in GetReshapeOutputType()
609 for (const auto &dim : llvm::enumerate(shape_attr.getIntValues())) { in GetReshapeOutputType()
2030 DenseIntElementsAttr shape_attr; in GetSlicedShapeAndBoundRanges() local
2032 if (!matchPattern(shape(), m_Constant(&shape_attr)) || in GetSlicedShapeAndBoundRanges()
2038 int rank = std::distance(shape_attr.begin(), shape_attr.end()); in GetSlicedShapeAndBoundRanges()
2042 for (const APInt &dim : shape_attr) in GetSlicedShapeAndBoundRanges()
Dtf_ops_helpers.inc234 auto shape_attr = DenseIntElementsAttr::get(new_shape_type, shape);
235 auto new_shape = builder->create<ConstOp>(loc, shape_attr);
Dtf_ops_a_m.cc1376 if (auto shape_attr = shape.dyn_cast_or_null<DenseIntElementsAttr>()) in fold() local
1377 shapes.push_back(shape_attr); in fold()
/external/tensorflow/tensorflow/compiler/mlir/tfr/ir/
Dtfr_ops.cc427 auto shape_attr = TF::ShapeAttr::get(rewriter.getContext(), shape); in matchAndRewrite() local
429 input, shape_attr); in matchAndRewrite()
/external/tensorflow/tensorflow/compiler/mlir/tosa/transforms/
Dlegalize_common.cc200 ArrayAttr shape_attr = rewriter.getI64ArrayAttr(reshape_output_shape); in convertPackOp() local
243 op->getLoc(), reshape_output_type, a1_concat_op.getResult(), shape_attr); in convertPackOp()
1281 ArrayAttr shape_attr = rewriter.getI64ArrayAttr(reshape_dims); in convertExpandDimsOp() local
1285 shape_attr) in convertExpandDimsOp()
1341 ArrayAttr shape_attr = rewriter.getI64ArrayAttr(reshape_dims); in convertSqueezeOp() local
1345 shape_attr) in convertSqueezeOp()
Dlegalize_tf.cc669 ArrayAttr shape_attr = rewriter.getI64ArrayAttr(shape_vals); in matchAndRewrite() local
672 op, output_type, tf_reshape_op.tensor(), shape_attr); in matchAndRewrite()
719 auto shape_attr = DenseElementsAttr::get( in matchAndRewrite() local
722 rewriter.create<tosa::ConstOp>(op->getLoc(), shape_type, shape_attr); in matchAndRewrite()
Dlegalize_tfl.cc1587 ArrayAttr shape_attr = rewriter.getI64ArrayAttr(shape_vals); in matchAndRewrite() local
1590 op, output_type, tfl_reshape_op.input(), shape_attr); in matchAndRewrite()
1637 auto shape_attr = DenseElementsAttr::get( in matchAndRewrite() local
1640 rewriter.create<tosa::ConstOp>(op->getLoc(), shape_type, shape_attr); in matchAndRewrite()
/external/tensorflow/tensorflow/compiler/mlir/lite/
Dflatbuffer_import.cc729 mlir::DenseIntElementsAttr shape_attr; in ConvertOp() local
730 if (matchPattern(op_state.operands[1], m_Constant(&shape_attr))) { in ConvertOp()
736 for (const auto& dim : llvm::enumerate(shape_attr.getIntValues())) { in ConvertOp()
/external/tensorflow/tensorflow/compiler/mlir/lite/ir/
Dtfl_ops.cc1362 DenseIntElementsAttr shape_attr; in GetReshapeOutputType() local
1363 if (!matchPattern(shape, m_Constant(&shape_attr))) { in GetReshapeOutputType()
1380 output_ty_shape.reserve(shape_attr.getNumElements()); in GetReshapeOutputType()
1381 for (const auto &dim : llvm::enumerate(shape_attr.getIntValues())) { in GetReshapeOutputType()
/external/tensorflow/tensorflow/compiler/mlir/tensorflow/translate/
Dimport_model.cc1040 const AttrValue* shape_attr = node.attrs().Find("_handle_shapes"); in InferOutputType() local
1041 if (dtype_attr && shape_attr) { in InferOutputType()
1045 shape_attr->DebugString()); in InferOutputType()
1047 if (shape_attr->list().shape().empty()) { in InferOutputType()
1050 shape_attr->DebugString()); in InferOutputType()
1053 const TensorShapeProto& shape_proto = shape_attr->list().shape(0); in InferOutputType()
/external/tensorflow/tensorflow/core/grappler/costs/
Dgraph_properties.cc830 AttrValue shape_attr; in UpdateFunction() local
836 shape_handle, shape_attr.mutable_list()->add_shape()); in UpdateFunction()
839 (*fun_node->mutable_attr())["_handle_shapes"] = shape_attr; in UpdateFunction()
/external/tensorflow/tensorflow/core/common_runtime/
Ddirect_session_test.cc2407 AttrValue shape_attr; in CreateIdentityGraphDef() local
2408 shape_attr.mutable_shape()->set_unknown_rank(true); in CreateIdentityGraphDef()
2414 placeholder->mutable_attr()->insert({"shape", shape_attr}); in CreateIdentityGraphDef()