- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 22 for createBlock (0.22 sec)
-
tensorflow/compiler/mlir/tensorflow/transforms/functional_control_flow_to_cfg.cc
// Set up the 'then' block. Block* then_block = builder.createBlock(merge_block); Operation* call_op = CallFn(loc, get_operand, op.then_function(), &builder); auto get_then_result = [&](int i) { return call_op->getResult(i); }; JumpToBlock(loc, get_then_result, merge_block, &builder); // Set up the 'else' block. Block* else_block = builder.createBlock(merge_block);
Registered: Sun Jun 16 05:45:23 UTC 2024 - Last Modified: Fri Jan 13 11:42:59 UTC 2023 - 12.2K bytes - Viewed (0) -
tensorflow/compiler/mlir/tf2xla/transforms/utils.h
// reducer op. template <typename Op> void BuildReduceBody(Type element_type, Region* body, OpBuilder* builder) { OpBuilder::InsertionGuard guard(*builder); Block* block = builder->createBlock(body); // Block arguments are scalars of the given element type. Type type = RankedTensorType::get(/*shape=*/{}, element_type); Location loc = body->getLoc();
Registered: Sun Jun 16 05:45:23 UTC 2024 - Last Modified: Wed Sep 06 19:12:29 UTC 2023 - 2.3K bytes - Viewed (0) -
tensorflow/compiler/mlir/lite/transforms/legalize_tf_while.cc
} }; } // namespace // Inserts call to the given function into the 'region'. void CreateRegionWithCall(func::FuncOp func, Region& region, Location loc) { OpBuilder builder(region); auto block = builder.createBlock(®ion); SmallVector<Value, 4> new_operands; for (Type t : func.getFunctionType().getInputs()) new_operands.push_back(block->addArgument(t, loc)); auto call = builder.create<func::CallOp>(loc, func, new_operands);
Registered: Sun Jun 16 05:45:23 UTC 2024 - Last Modified: Thu Nov 03 12:35:38 UTC 2022 - 3.4K bytes - Viewed (0) -
tensorflow/compiler/mlir/tensorflow/transforms/convert_tf_control_flow_to_scf.cc
// a 1-bit signless integer. But, the condition of the `tf.WhileRegion` op // is a 0-D tensor of 1-bit signless integers. Thus, we use the // `tensor.extract` op to compute the input of `scf.condition`. rewriter.createBlock(&scf_while_op.getBefore()); Operation* cond_terminator = createScfCondOrBody(op.getCond(), scf_while_op.getBefore(), scf_block_arguments_type, rewriter);
Registered: Sun Jun 16 05:45:23 UTC 2024 - Last Modified: Thu Nov 03 12:35:38 UTC 2022 - 9.4K bytes - Viewed (0) -
tensorflow/compiler/mlir/tensorflow/transforms/decompose_reduce_dataset.cc
void PopulateDatasetWhileCond(OpBuilder builder, WhileRegionOp dataset_while, Location loc) { auto& cond_region = dataset_while.getCond(); Block* cond_block = builder.createBlock(&cond_region); auto while_input_types = dataset_while.getOperandTypes(); cond_block->addArguments( while_input_types, SmallVector<Location>(while_input_types.size(), loc));
Registered: Sun Jun 16 05:45:23 UTC 2024 - Last Modified: Thu Apr 25 16:01:03 UTC 2024 - 14K bytes - Viewed (0) -
tensorflow/compiler/mlir/quantization/tensorflow/ops/tf_quantize_op.cc
OpBuilder::InsertionGuard guard = OpBuilder::InsertionGuard(rewriter); ArrayRef<Type> inputs = quantization_func.getFunctionType().getInputs(); Block* block = rewriter.createBlock( &quantization_func.getBody(), quantization_func.begin(), inputs, SmallVector<Location>(inputs.size(), quantization_func.getLoc())); func_input_arg = block->getArgument(0); return quantization_func; }
Registered: Sun Jun 16 05:45:23 UTC 2024 - Last Modified: Thu Apr 25 16:01:03 UTC 2024 - 11K bytes - Viewed (0) -
tensorflow/compiler/mlir/tensorflow/transforms/functional_control_flow_to_regions.cc
bool forward_block_args) { assert(caller_region.empty() && "Expected empty region for newly created ops"); OpBuilder builder(caller_region); Block* entry = builder.createBlock(&caller_region); auto loc = op->getLoc(); if (use_region_args) { auto inputs = func.getFunctionType().getInputs(); entry->addArguments(inputs, SmallVector<Location>(inputs.size(), loc));
Registered: Sun Jun 16 05:45:23 UTC 2024 - Last Modified: Thu Apr 25 16:01:03 UTC 2024 - 11K bytes - Viewed (0) -
tensorflow/compiler/mlir/lite/transforms/while_loop_outline.cc
num_loop_carried, extern_values, types, loc); OpBuilder b(region); // The body of the region is empty/has been outlined into the function. auto block = b.createBlock(®ion); SmallVector<Value, 4> new_operands; new_operands.reserve(types.size()); for (Type t : llvm::ArrayRef(types).drop_back(extern_values.size())) new_operands.push_back(block->addArgument(t, loc));
Registered: Sun Jun 16 05:45:23 UTC 2024 - Last Modified: Thu Apr 25 16:01:03 UTC 2024 - 11.8K bytes - Viewed (0) -
tensorflow/compiler/mlir/quantization/tensorflow/passes/unfreeze_constants.cc
const auto func_type = builder.getFunctionType(/*inputs=*/{}, /*results=*/{}); auto init_func = builder.create<func::FuncOp>( loc, /*sym_name=*/"init_func_restore_op", func_type); builder.createBlock(&init_func.getBody(), /*insertPt=*/init_func.begin(), /*arg_types=*/{}, /*arg_locs=*/{}); init_func->setAttr(kTfSavedModelExportedNamesAttr, builder.getStrArrayAttr(
Registered: Sun Jun 16 05:45:23 UTC 2024 - Last Modified: Wed Aug 16 15:04:53 UTC 2023 - 14K bytes - Viewed (0) -
tensorflow/compiler/mlir/quantization/tensorflow/passes/insert_main_function.cc
auto func_type = FunctionType::get(context, arg_types, result_types); auto main_func = builder.create<func::FuncOp>( module_op.getLoc(), kImportModelDefaultGraphFuncName, func_type); builder.createBlock(&main_func.getBody(), main_func.begin(), arg_types, arg_locs); SmallVector<NamedAttribute> func_attrs; func_attrs.push_back( {StringAttr::get(context, "inputs"),
Registered: Sun Jun 16 05:45:23 UTC 2024 - Last Modified: Thu Apr 25 16:01:03 UTC 2024 - 16.5K bytes - Viewed (0)