/external/tensorflow/tensorflow/lite/toco/graph_transformations/ |
D | reorder_reshape_transpose.cc | 128 TensorFlowReshapeOperator* reshape_op = in Run() local 131 if (reshape_op == nullptr) { in Run() 136 if (!OperatorReady(*model, reshape_op) || reshape_op->shape.empty()) { in Run() 141 const std::string input_name = reshape_op->inputs[0]; in Run() 142 const std::string intermediate_name = reshape_op->outputs[0]; in Run() 177 if (!ReshapeIsEquivalentToTranspose(*model, reshape_op, in Run() 191 reshape_op->inputs[0] = new_intermediate_name; in Run() 192 reshape_op->outputs[0] = output_name; in Run() 206 reshape_op->inputs[0] = output_name; in Run() 228 if (CountOpsWithInput(*model, reshape_op->inputs[1]) != 1) { in Run() [all …]
|
D | move_binary_operator_before_reshape.cc | 122 Operator* reshape_op = reshape_it->get(); in Run() local 123 if (reshape_op->type != OperatorType::kReshape) { in Run() 125 LogName(*binary_op), LogName(*reshape_op)); in Run() 128 const auto& reshape_input_array = model->GetArray(reshape_op->inputs[0]); in Run() 138 model->GetArray(reshape_op->outputs[0]).shape())) { in Run() 149 LogName(*binary_op), LogName(*reshape_op)); in Run() 160 LogName(*binary_op), LogName(*reshape_op)); in Run() 166 LogName(*reshape_op)); in Run() 169 std::iter_swap(reshape_op->inputs.begin(), in Run() 171 std::iter_swap(reshape_op->outputs.begin(), binary_op->outputs.begin()); in Run()
|
D | merge_reshape_into_preceding_transpose.cc | 109 auto* reshape_op = ConvertOperator<TensorFlowReshapeOperator*>( in Run() local 112 if (reshape_op == nullptr) { in Run() 116 if (!OperatorReady(*model, reshape_op) || reshape_op->shape.empty()) { in Run() 120 const std::string intermediate_name = reshape_op->inputs[0]; in Run() 121 const std::string output_name = reshape_op->outputs[0]; in Run() 146 if (!ReshapeIsEquivalentToTranspose(*model, reshape_op, in Run() 156 LogName(*transpose_op), LogName(*reshape_op)); in Run() 161 LogName(*reshape_op)); in Run() 166 auto merged_perm = ReshapeToTranspose(*model, reshape_op); in Run()
|
D | resolve_reshape_attributes.cc | 33 auto* reshape_op = reshape_it->get(); in Run() local 34 if (reshape_op->type != OperatorType::kReshape) { in Run() 38 auto* op = static_cast<TensorFlowReshapeOperator*>(reshape_op); in Run() 42 if (IsConstantParameterArray(*model, reshape_op->inputs[1])) { in Run() 43 const auto& constant_input_array = model->GetArray(reshape_op->inputs[1]); in Run()
|
D | remove_trivial_reshape.cc | 89 auto* reshape_op = reshape_it->get(); in Run() local 90 if (reshape_op->type != OperatorType::kReshape) { in Run() 94 if (!IsReshapeTrivial(*model, *reshape_op, this)) { in Run() 95 AddMessageF("%s is not trivial", LogName(*reshape_op)); in Run() 99 AddMessageF("Removing trivial %s", LogName(*reshape_op)); in Run() 101 CHECK_EQ(reshape_op->inputs.size(), 2); in Run()
|
D | convert_reorder_axes.cc | 31 auto* reshape_op = new TensorFlowReshapeOperator; in CreateReshapeFromReorderAxes() local 34 reshape_op->inputs.push_back(reorder_op->inputs[0]); in CreateReshapeFromReorderAxes() 35 reshape_op->outputs = reorder_op->outputs; in CreateReshapeFromReorderAxes() 45 AvailableArrayName(*model, reshape_op->outputs[0]); in CreateReshapeFromReorderAxes() 46 reshape_op->inputs.push_back(reshape_array_name); in CreateReshapeFromReorderAxes() 56 return reshape_op; in CreateReshapeFromReorderAxes() 134 auto* reshape_op = in Run() local 136 model->operators.emplace(reorder_it, reshape_op); in Run()
|
D | convert_squeeze_to_reshape.cc | 68 auto* reshape_op = new TensorFlowReshapeOperator; in Run() local 69 reshape_op->inputs = { in Run() 74 reshape_op->outputs = squeeze_op->outputs; in Run() 77 LogName(*reshape_op)); in Run() 80 model->operators.emplace(squeeze_it, reshape_op); in Run()
|
D | convert_trivial_pack_to_reshape.cc | 57 auto* reshape_op = new TensorFlowReshapeOperator; in Run() local 58 reshape_op->inputs = {pack_op->inputs[0]}; in Run() 59 reshape_op->outputs = pack_op->outputs; in Run() 67 reshape_op->inputs.push_back(shape_array_name); in Run() 80 model->operators.emplace(pack_it, reshape_op); in Run()
|
D | convert_expanddims_to_reshape.cc | 72 auto* reshape_op = new TensorFlowReshapeOperator; in Run() local 75 reshape_op->inputs.push_back(expand_op->inputs[0]); in Run() 76 reshape_op->outputs = expand_op->outputs; in Run() 85 reshape_op->inputs.push_back(shape_array_name); in Run() 98 model->operators.emplace(expand_it, reshape_op); in Run()
|
D | convert_trivial_transpose_to_reshape.cc | 87 auto* reshape_op = new TensorFlowReshapeOperator; in Run() local 90 reshape_op->inputs.push_back(transpose_op->inputs[0]); in Run() 91 reshape_op->outputs = transpose_op->outputs; in Run() 100 reshape_op->inputs.push_back(shape_array_name); in Run() 112 model->operators.emplace(transpose_it, reshape_op); in Run()
|
D | unroll_batch_matmul.cc | 47 auto* reshape_op = new TensorFlowReshapeOperator; in SliceInput() local 48 reshape_op->inputs = { in SliceInput() 52 reshape_op->outputs = {AvailableArrayName( in SliceInput() 54 auto& reshape_op_output = model->GetOrCreateArray(reshape_op->outputs[0]); in SliceInput() 56 *tail_it = model->operators.emplace(*tail_it, reshape_op) + 1; in SliceInput() 66 reshape_op->outputs[0], in SliceInput()
|
D | identify_nearest_upsample.cc | 188 auto* reshape_op = new TensorFlowReshapeOperator; in Run() local 189 to_be_inserted_ops.push_back(reshape_op); in Run() 192 reshape_op->inputs.push_back(original_array_name); in Run() 196 reshape_op->inputs.push_back(shape_array_name); in Run() 224 reshape_op->outputs.push_back(reshape_output_name); in Run()
|
/external/tensorflow/tensorflow/lite/delegates/hexagon/builders/ |
D | rsqrt_builder.cc | 112 auto* reshape_op = graph_builder_->AddNode(GetTFLiteNodeID()); in PopulateSubGraph() local 113 reshape_op->SetOpType(OP_Reshape); in PopulateSubGraph() 114 reshape_op->AddInput(sqrt_output); in PopulateSubGraph() 115 reshape_op->AddInput(TensorID(target_shape_node->GetID(), 0)); in PopulateSubGraph() 116 auto reshape_out = reshape_op->AddOutput(sizeof(uint8_t), 4, flat_shape); in PopulateSubGraph() 158 reshape_op = graph_builder_->AddNode(GetTFLiteNodeID()); in PopulateSubGraph() 159 reshape_op->SetOpType(OP_Reshape); in PopulateSubGraph() 160 reshape_op->AddInput(div_output); in PopulateSubGraph() 161 reshape_op->AddInput(TensorID(target_shape_node->GetID(), 0)); in PopulateSubGraph() 162 node_output_ = reshape_op->AddOutput(sizeof(uint8_t), 4, output_shape); in PopulateSubGraph()
|
/external/tensorflow/tensorflow/compiler/mlir/tensorflow/transforms/ |
D | unroll_batch_matmul.cc | 110 auto reshape_op = createReshapeOp(value, {num_rows, num_cols}, element_type, in sliceInput() local 112 sliced.emplace_back(reshape_op.output()); in sliceInput() 115 auto reshape_op = createReshapeOp(value, {batch_size, num_rows, num_cols}, in sliceInput() local 130 loc, output_types, split_dimension_op.output(), reshape_op.output()); in sliceInput() 135 auto reshape_op = createReshapeOp(split_value, {num_rows, num_cols}, in sliceInput() local 138 sliced.emplace_back(reshape_op.output()); in sliceInput() 280 auto reshape_op = createReshapeOp(pack_op.output(), result_shape, in matchAndRewrite() local 282 rewriter.replaceOp(op, reshape_op.output()); in matchAndRewrite()
|
D | optimize.cc | 58 auto reshape_op = llvm::dyn_cast_or_null<ReshapeOp>(user); in matchAndRewrite() local 59 if (!reshape_op) return failure(); in matchAndRewrite() 61 auto reshape_type = reshape_op.output().getType().cast<ShapedType>(); in matchAndRewrite() 128 reshape_op, reshape_op.output().getType(), new_reshape, in matchAndRewrite()
|
D | tpu_space_to_depth_pass.cc | 251 auto reshape_op = in HandleConv2DFilter() local 255 auto transpose_op = GetTransposeOpForConv2DFilter(&builder, reshape_op); in HandleConv2DFilter()
|
/external/tensorflow/tensorflow/compiler/mlir/tfrt/jit/transforms/ |
D | tf_jitrt_fusion.cc | 94 static bool IsUnitDimExpansionOnly(TensorReshapeOp reshape_op) { in IsUnitDimExpansionOnly() argument 98 (is_expanding ? reshape_op.getResultType().getShape() in IsUnitDimExpansionOnly() 99 : reshape_op.getSrcType().getShape()); in IsUnitDimExpansionOnly() 100 for (auto &indices : reshape_op.getReassociationIndices()) { in IsUnitDimExpansionOnly()
|
/external/tensorflow/tensorflow/c/ |
D | c_api_experimental_test.cc | 205 TFE_Op* reshape_op = TFE_NewOp(tfe_context_, "Reshape", status_); in TEST_F() local 207 TFE_OpSetAttrType(reshape_op, "T", TF_FLOAT); in TEST_F() 208 TFE_OpSetAttrType(reshape_op, "Tshape", TF_INT32); in TEST_F() 209 CheckOutputShapes(reshape_op, in TEST_F() 213 TFE_DeleteOp(reshape_op); in TEST_F() 214 reshape_op = nullptr; in TEST_F()
|
/external/tensorflow/tensorflow/compiler/mlir/lite/experimental/tac/transforms/ |
D | device_transform_patterns.cc | 252 auto reshape_op = in matchAndRewrite() local 257 rewriter.replaceOp(pack_op, reshape_op.getResult()); in matchAndRewrite() 408 auto reshape_op = in matchAndRewrite() local 425 slice_op.getLoc(), new_output_type, reshape_op, new_begin, new_size); in matchAndRewrite() 558 auto reshape_op = in matchAndRewrite() local 561 reshape_ops.push_back(reshape_op.getResult()); in matchAndRewrite() 652 auto reshape_op = in matchAndRewrite() local 655 value_to_replace = reshape_op.getResult(); in matchAndRewrite()
|
/external/tensorflow/tensorflow/compiler/mlir/quantization/tensorflow/utils/ |
D | tf_to_xla_attribute_utils.cc | 114 auto reshape_op = [&](Value value, const SmallVector<int64_t> &shape) { in PadForDynamicShapedInputSamePadding() local 120 auto scalar_to_rank1 = [&](Value value) { return reshape_op(value, {1}); }; in PadForDynamicShapedInputSamePadding() 126 Value temp_padding = reshape_op(temp_padding_rank1, {4, 2}); in PadForDynamicShapedInputSamePadding()
|
/external/tensorflow/tensorflow/lite/toco/ |
D | export_tensorflow.cc | 618 tensorflow::NodeDef* reshape_op = tensorflow_graph->add_node(); in ConvertFullyConnectedOperator() local 619 reshape_op->set_op("Reshape"); in ConvertFullyConnectedOperator() 620 reshape_op->set_name(reshape_output); in ConvertFullyConnectedOperator() 621 reshape_op->add_input(src_op.inputs[0]); in ConvertFullyConnectedOperator() 622 reshape_op->add_input(reshape_shape); in ConvertFullyConnectedOperator() 623 (*reshape_op->mutable_attr())["T"].set_type( in ConvertFullyConnectedOperator() 833 tensorflow::NodeDef* reshape_op = tensorflow_graph->add_node(); in ConvertSoftmaxOperator() local 834 reshape_op->set_op("Reshape"); in ConvertSoftmaxOperator() 835 reshape_op->set_name(reshape_output); in ConvertSoftmaxOperator() 836 *reshape_op->add_input() = src_op.inputs[0]; in ConvertSoftmaxOperator() [all …]
|
/external/tensorflow/tensorflow/dtensor/mlir/expansions/ |
D | meta_spmd_expander.cc | 774 auto reshape_op = mlir::cast<mlir::TF::ReshapeOp>(op); in ExpandOp() local 777 EmitRelayout(reshape_op.tensor(), *input_layout, desired_input_layout)); in ExpandOp() 807 auto reshape_op = mlir::cast<mlir::TF::ReshapeOp>(op); in ComputeLayoutForward() local 810 GetShapeOfValue(reshape_op.tensor(), /*fail_on_dynamic=*/true)); in ComputeLayoutForward() 813 GetShapeOfValue(reshape_op.output(), /*fail_on_dynamic=*/true)); in ComputeLayoutForward() 840 auto reshape_op = mlir::cast<mlir::TF::ReshapeOp>(op); in ComputeLayoutBackward() local 843 GetShapeOfValue(reshape_op.tensor(), /*fail_on_dynamic=*/true)); in ComputeLayoutBackward() 846 GetShapeOfValue(reshape_op.output(), /*fail_on_dynamic=*/true)); in ComputeLayoutBackward()
|
/external/tensorflow/tensorflow/compiler/mlir/lite/transforms/ |
D | optimize.cc | 1375 auto reshape_op = input.getDefiningOp<TFL::ReshapeOp>(); in matchAndRewrite() local 1376 if (!reshape_op) return failure(); in matchAndRewrite() 1379 auto reshape_input = reshape_op.input(); in matchAndRewrite() 1412 LogicalResult matchAndRewrite(TFL::ReshapeOp reshape_op, in matchAndRewrite() 1415 reshape_op.input().getDefiningOp()); in matchAndRewrite() 1420 if (!reshape_op.input().hasOneUse()) return failure(); in matchAndRewrite() 1424 auto reshape_shape = reshape_op.getType().cast<ShapedType>(); in matchAndRewrite() 1438 llvm::SmallVector<Type, 1> output_type{reshape_op.getType()}; in matchAndRewrite() 1440 reshape_op, output_type, /*input=*/fully_connected_op.input(), in matchAndRewrite()
|
/external/tensorflow/tensorflow/core/transforms/constant_folding/ |
D | pass.cc | 2028 Operation *reshape_op = in matchAndRewrite() local 2030 if (!reshape_op) return failure(); in matchAndRewrite() 2032 rewriter.replaceOp(op, reshape_op->getResults()); in matchAndRewrite() 2075 Operation *reshape_op = builder.create(state); in ReplaceReductionWithReshape() local 2076 TFOp(reshape_op).setName(TFOp(op).nameAttr()); in ReplaceReductionWithReshape() 2078 TFOp(reshape_op).setRequestedDevice(TFOp(op).deviceAttr()); in ReplaceReductionWithReshape() 2079 return reshape_op; in ReplaceReductionWithReshape()
|
/external/tensorflow/tensorflow/core/kernels/ |
D | eigen_spatial_convolutions_test.cc | 1515 const auto reshape_op = in PackRhsHelper() local 1519 evaluators.emplace_back(reshape_op, device); in PackRhsHelper() 1688 const auto reshape_op = in PackLhsHelper() local 1691 evaluators.emplace_back(reshape_op, device); in PackLhsHelper()
|