Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 12 for createBlock (0.18 sec)

  1. 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)
  2. 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)
  3. 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)
  4. 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)
  5. 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(&region);
      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)
  6. 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)
  7. 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)
  8. tensorflow/compiler/mlir/quantization/common/lift_as_function_call.cc

      if (call_op_type == FunctionCallOpType::TFXlaCallModuleOp) {
        wrap_func->setAttr(TF::kFromXlaCallModuleAttrName, builder.getUnitAttr());
      }
      wrap_func->setAttr(kFusedFunctionAttr, builder.getUnitAttr());
      builder.createBlock(&wrap_func.getBody(), wrap_func.begin(), arg_types,
                          arg_locs);
    
      IRMapping mapping;
      for (int32_t i : llvm::seq<int32_t>(0, arguments.size())) {
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Fri May 17 17:58:54 UTC 2024
    - 21.8K bytes
    - Viewed (0)
  9. tensorflow/compiler/mlir/quantization/stablehlo/passes/replace_stablehlo_ops_in_main_function_with_xla_call_module_ops.cc

      stablehlo_func_op.setVisibility(SymbolTable::Visibility::Private);
      stablehlo_func_op->setAttr(TF::kFromXlaCallModuleAttrName,
                                 builder.getUnitAttr());
    
      builder.createBlock(&stablehlo_func_op.getBody(), stablehlo_func_op.begin(),
                          arg_types, arg_locs);
    
      IRMapping mapper;
      // stablehlo_func_op has 1 extra arg for platform index.
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 21K bytes
    - Viewed (0)
  10. tensorflow/compiler/mlir/tensorflow/transforms/cluster_ops_by_policy.cc

      auto cluster_op =
          builder.create<tf_device::ClusterOp>(loc, return_types, policy);
    
      // Create block in cluster_op's region and move 'cluster.operations' into
      // it.
      auto block = builder.createBlock(&cluster_op.getBody());
      auto block_end = block->end();
      for (auto op : cluster.operations) op->moveBefore(block, block_end);
    
      // Add 'tf_device::ReturnOp' at the end of the block.
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 27.9K bytes
    - Viewed (0)
Back to top