Search Options

Results per page
Sort
Preferred Languages
Advance

Results 51 - 60 of 68 for BlockArgument (0.39 sec)

  1. tensorflow/compiler/mlir/lite/stablehlo/odml_converter/transforms/outline_composites.cc

    // if the given operation is the only user.
    Operation* GetInputOpWithOneUse(Operation* op, int opr_num) {
      if (opr_num >= op->getNumOperands()) return nullptr;
      auto opr = op->getOperand(opr_num);
      if (llvm::isa<BlockArgument>(opr)) return nullptr;
      auto* res = opr.getDefiningOp();
      if (!res->hasOneUse()) return nullptr;
      return res;
    }
    
    // Checks if the given operand of given operation refers to a splat constant
    // with given val.
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Fri May 17 17:58:54 UTC 2024
    - 9.6K bytes
    - Viewed (0)
  2. tensorflow/compiler/mlir/quantization/stablehlo/passes/quantization_patterns.h

          return failure();
        }
    
        Operation* operand_op = operand.getDefiningOp();
        if (operand_op == nullptr) {
          // When `QuantizeOpT`'s operand does not have a defining op, it means it
          // is a `BlockArgument`. The pattern does not match if there is no op to
          // quantize.
          return failure();
        }
    
        if (operand_op->hasTrait<OpTrait::ConstantLike>()) {
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 10.9K bytes
    - Viewed (0)
  3. tensorflow/compiler/mlir/tensorflow/transforms/tpu_device_propagation.cc

      return new_device;
    }
    
    // Propagates devices from function arguments.
    void PropagateDevicesFromArguments(
        func::FuncOp func,
        llvm::DenseMap<Value, llvm::StringRef>& value_to_device) {
      for (BlockArgument& arg : func.getArguments()) {
        auto arg_device_attr =
            func.getArgAttrOfType<StringAttr>(arg.getArgNumber(), kFuncDeviceAttr);
        if (!arg_device_attr || arg_device_attr.getValue().empty() ||
    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/prepare_tpu_computation_for_tf_export.cc

        constexpr char kShardingAttr[] = "mhlo.sharding";
        if (auto sharding =
                func.getArgAttrOfType<mlir::StringAttr>(i, kShardingAttr)) {
          if (!sharding.getValue().empty()) {
            BlockArgument arg = func.getArgument(i);
            // TODO(hinsu): Instead of setting both 'sharding' and '_XlaSharding'
            // attributes, only set the 'sharding' attribute. Both attributes are
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 11.8K bytes
    - Viewed (0)
  5. tensorflow/compiler/mlir/tensorflow/analysis/resource_alias_analysis.cc

      // the result cannot be backtracked to a region argument, returns
      // std::nullopt.
      std::optional<int> GetArg(int result_index) const {
        if (auto arg = mlir::dyn_cast<BlockArgument>(GetValue(result_index)))
          if (arg.getParentBlock() == &region_->front()) return arg.getArgNumber();
        return std::nullopt;
      }
    
     private:
      friend class detail::BacktrackAnalysis;
    
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Wed May 15 09:04:13 UTC 2024
    - 28.2K bytes
    - Viewed (0)
  6. tensorflow/compiler/mlir/quantization/tensorflow/passes/merge_initializer_function_ops_to_main.cc

        // During cloning, let it know that the source function's argument
        // corresponds to the main function's newly created argument when cloning
        // ops from src -> main.
        BlockArgument main_arg = main_func_op.getArgument(main_arg_idx);
        mapper.map(src_arg, main_arg);
      }
    
      return mapper;
    }
    
    // Copies ops from `src_func_op` to `main_body` except for the FetchOps. Returns
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Sun May 12 12:54:52 UTC 2024
    - 15.3K bytes
    - Viewed (0)
  7. tensorflow/compiler/mlir/lite/transforms/lower_static_tensor_list.cc

        func::FuncOp func, const llvm::SmallSet<int, 4> &tensor_list_args) {
      // `indexes` stores the argument index of tensorlists which size may get
      // updated in the function.
      llvm::SmallSet<int, 4> indexes;
      for (BlockArgument &arg : func.getArguments()) {
        if (tensor_list_args.contains(arg.getArgNumber())) {
          for (const mlir::OpOperand &use : arg.getUses()) {
            mlir::Operation *op = use.getOwner();
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Tue Jun 11 20:00:43 UTC 2024
    - 70.7K bytes
    - Viewed (0)
  8. tensorflow/compiler/mlir/tensorflow/transforms/tensor_list_ops_decomposition.cc

        }
      } else {
        info.signature_change = true;
        for (auto& entry : callee_map) {
          auto buffer_arg = mlir::dyn_cast<BlockArgument>(entry.getFirst());
          if (!buffer_arg) continue;
          info.buffer_arg_to_size_arg[buffer_arg.getArgNumber()] =
              mlir::cast<BlockArgument>(entry.getSecond().size).getArgNumber();
        }
        if (lowered_callee != callee) {
          // Add the clone with a new name.
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 39.2K bytes
    - Viewed (0)
  9. tensorflow/compiler/mlir/quantization/tensorflow/passes/insert_main_function.cc

      int result_idx = 0;
      llvm::SmallVector<Value> call_op_returns;
      for (auto func_op : module_op.getOps<func::FuncOp>()) {
        if (!ShouldIncludeInMainFunction(func_op)) continue;
    
        llvm::ArrayRef<BlockArgument> new_args = llvm::ArrayRef(
            main_func.getArguments().begin() + arg_idx, func_op.getNumArguments());
        arg_idx += func_op.getNumArguments();
        llvm::ArrayRef<Type> new_types = llvm::ArrayRef(
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 16.5K bytes
    - Viewed (0)
  10. tensorflow/compiler/mlir/quantization/stablehlo/passes/quantization_patterns.cc

        LLVM_DEBUG(llvm::dbgs() << GemmStyleOp::getOperationName()
                                << " op must have ranked tensor type.\n");
        return failure();
      }
    
      MutableArrayRef<BlockArgument> operands =
          entry_func_op.getBody().getArguments();
      // Function must have input, filter, and optionally bias.
      if (operands.size() != 2 && operands.size() != 3) {
    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