Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 1,755 for functor (0.11 sec)

  1. tensorflow/compiler/mlir/quantization/tensorflow/passes/insert_main_function.cc

    }
    
    // Check if a function is an entry function.
    bool IsEntryFunction(func::FuncOp op) {
      return op->hasAttr(kEntryFunctionAttr);
    }
    
    // Returns true iff the provided FuncOp is qualified to be included in the main
    // function.
    bool ShouldIncludeInMainFunction(func::FuncOp func_op) {
      return !func_op.isPrivate() && IsExported(func_op) &&
             IsEntryFunction(func_op);
    }
    
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 16.5K bytes
    - Viewed (0)
  2. tensorflow/compiler/mlir/quantization/tensorflow/passes/merge_save_function_ops_to_main.cc

      return func_op->getNumRegions() == 0 || func_op.getBody().empty();
    }
    
    // Gets the GraphOp from the function op. Returns an empty op iff it doesn't
    // exist.
    GraphOp GetGraphOpFromFuncOp(func::FuncOp func_op) {
      if (IsFuncOpEmpty(func_op)) return {};
    
      auto graph_op_range = func_op.front().without_terminator();
      if (llvm::hasSingleElement(graph_op_range)) {
        // The pass runs on a valid tf_executor dialect, so the op should be the
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 10.7K bytes
    - Viewed (0)
  3. tensorflow/compiler/mlir/tensorflow/transforms/tf_saved_model_freeze_variables.cc

        // Builder builder(func_op.getContext());
        func_op->setAttr(
            kTfInputShapesAttr,
            ArrayAttr::get(func_op.getContext(), updated_input_shapes_attr));
      }
    }
    
    // Validates func ops. Returns `failure` if the function is invalid.
    LogicalResult ValidateFuncOp(func::FuncOp func_op) {
      auto input_shapes_attr =
          func_op->getAttrOfType<ArrayAttr>(kTfInputShapesAttr);
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 09:56:53 UTC 2024
    - 19.4K bytes
    - Viewed (0)
  4. tensorflow/compiler/mlir/quantization/tensorflow/passes/merge_initializer_function_ops_to_main.cc

      }
    };
    
    // Returns true iff func_op has either no Region or the body has no Blocks.
    bool IsFuncOpEmpty(func::FuncOp func_op) {
      return func_op->getNumRegions() == 0 || func_op.getBody().empty();
    }
    
    // Gets the GraphOp from the function op. Returns an empty op iff it doesn't
    // exist.
    GraphOp GetGraphOpFromFuncOp(func::FuncOp func_op) {
      if (IsFuncOpEmpty(func_op)) return {};
    
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Sun May 12 12:54:52 UTC 2024
    - 15.3K bytes
    - Viewed (0)
  5. tensorflow/compiler/mlir/tensorflow/transforms/promote_resources_to_args.cc

    constexpr char kResourceFunctionMsg[] =
        "expects function level resource argument";
    constexpr char kInvalidResourceMsg[] =
        "expects resource to be a VarHandleOp or function argument";
    constexpr char kResourceNameArgAttr[] = "tf.resource_name";
    
    // Checks if a function has only one block.
    mlir::LogicalResult CheckSingleBlockFunction(func::FuncOp function) {
      if (!llvm::hasSingleElement(function)) {
        return function.emitError()
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 17.1K bytes
    - Viewed (0)
  6. tensorflow/compiler/mlir/tensorflow/transforms/resource_op_lifting_cleanup.cc

        result.replaceAllUsesWith(new_op->getResult(next_result_idx++));
      }
      op->erase();
    }
    
    // Clones a function if it cannot be patched in place. Clone if there are
    // multiple uses or unknown uses (for external functions). The cloned function
    // will be marked as private.
    func::FuncOp CloneFunctionIfNeeded(func::FuncOp func) {
      ModuleOp module = func->getParentOfType<ModuleOp>();
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 19.7K bytes
    - Viewed (0)
  7. tensorflow/compiler/mlir/quantization/stablehlo/passes/defer_activation_transpose.cc

    void DeferActivationTransposePass::runOnOperation() {
      func::FuncOp func_op = getOperation();
      MLIRContext& ctx = getContext();
    
      RewritePatternSet patterns(&ctx);
      patterns.add<DeferActivationTransposeForAddOp,
                   DeferActivationTransposeForMaxPoolReduceWindowOp,
                   DeferActivationTransposeForMaxOp>(&ctx);
      if (failed(applyPatternsAndFoldGreedily(func_op, std::move(patterns)))) {
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 11.5K bytes
    - Viewed (0)
  8. tensorflow/compiler/mlir/quantization/tensorflow/ops/tf_quantize_op.cc

        absl::StrAppend(&unique_func_name, "_");
      }
    
      Value func_input_arg;
      // Creates a function.
      func::FuncOp func_op = PrepareFunctionRegister(
          rewriter, input_val, result_type, unique_func_name, func_input_arg);
    
      // Fills the body.
      Operation* last_op_in_func =
          quantization_operations_func(rewriter, func_op.getOperation(),
                                       func_input_arg, result_type, quant_type);
    
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 11K bytes
    - Viewed (0)
  9. tensorflow/compiler/mlir/tensorflow/transforms/decompose_reduce_dataset.cc

    }
    
    // Decomposes any ReduceDatasetOps in `function` into a dataset iteration and a
    // call to the reduce function in the ReduceDatasetOp.
    LogicalResult DecomposeReduceDatasetInFunction(FuncOp function) {
      if (!llvm::hasSingleElement(function))
        return function.emitOpError("Expecting a single block function");
    
      auto decompose_result = function.walk([&](ReduceDatasetOp reduce_dataset) {
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 14K bytes
    - Viewed (0)
  10. tensorflow/compiler/mlir/quantization/stablehlo/passes/quantization_patterns.cc

      return dyn_cast_or_null<func::FuncOp>(
          symbol_table.lookup(entry_function_symbol_ref.getValue()));
    }
    
    // Replaces the function type of `entry_func_op` to a quantized one, matching
    // the input and output types of `xla_call_module_op`.
    void SetQuantizedFunctionType(PatternRewriter& rewriter,
                                  func::FuncOp entry_func_op,
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Fri May 03 06:04:36 UTC 2024
    - 41.7K bytes
    - Viewed (0)
Back to top