Search Options

Results per page
Sort
Preferred Languages
Advance

Results 51 - 60 of 74 for BlockArgument (0.34 sec)

  1. tensorflow/compiler/mlir/lite/transforms/prepare_quantize.cc

        return (arg.hasOneUse() &&
                llvm::isa<quantfork::QuantizeCastOp>(*arg.user_begin()));
      };
    
      bool need_to_set_input_nodes_quantization_params = false;
      for (const BlockArgument arg : func.getArguments()) {
        auto shaped = mlir::dyn_cast<ShapedType>(arg.getType());
        if (shaped && mlir::isa<FloatType>(shaped.getElementType()) &&
            !has_quantize_op(arg)) {
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 17.6K bytes
    - Viewed (0)
  2. tensorflow/compiler/mlir/tensorflow/transforms/executor_tpuv1_outline_tpu_island.cc

        // created entry block arguments in the function body.
        {
          Block &entry_block = outlined_func.getBody().front();
          auto loc = outlined_func.getLoc();
          for (Value operand : operands) {
            BlockArgument newArg = entry_block.addArgument(operand.getType(), loc);
            replaceAllUsesInRegionWith(operand, newArg, outlined_func.getBody());
          }
        }
    
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 8.7K bytes
    - Viewed (0)
  3. tensorflow/compiler/mlir/tensorflow/transforms/tpu_resource_partitioning.cc

      if (auto* resource_op = resource.getDefiningOp()) {
        return resource_op->getAttr(kDeviceAttr);
      } else {
        const auto resource_arg = resource.dyn_cast_or_null<BlockArgument>();
        if (resource_arg && (resource_arg.getOwner() == &(func.front()))) {
          return func.getArgAttrOfType<mlir::StringAttr>(
              resource_arg.getArgNumber(), kFuncDeviceAttr);
        } else {
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Wed Sep 06 19:12:29 UTC 2023
    - 11.8K bytes
    - Viewed (0)
  4. tensorflow/compiler/mlir/quantization/tensorflow/passes/insert_save_op.cc

      }
    
      TF::ConstOp tensor_names_const =
          CreateTensorNamesConst(tensor_names, builder);
      TF::ConstOp shape_and_slices_const =
          CreateShapeAndSlicesConst(tensor_names.size(), builder);
    
      BlockArgument filename_arg = save_func.getArgument(0);
      return builder.create<TF::SaveV2Op>(
          NameLoc::get(builder.getStringAttr(kTfQuantSaveV2OpName)),
          /*prefix=*/filename_arg, tensor_names_const, shape_and_slices_const,
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Fri Mar 22 05:52:39 UTC 2024
    - 9.5K bytes
    - Viewed (0)
  5. tensorflow/compiler/mlir/tensorflow/transforms/host_runtime/tpu_variable_runtime_reformatting.cc

        if (!arg.hasOneUse() ||
            !mlir::isa<TF::ResourceType>(getElementTypeOrSelf(arg.getType()))) {
          continue;
        }
        auto block_arg = mlir::dyn_cast<BlockArgument>(arg);
        if (!block_arg || block_arg.getOwner() != &replicate.GetBody()) continue;
        assert(replicate_arg_to_execute_arg.count(block_arg.getArgNumber()) == 0 &&
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 21.9K bytes
    - Viewed (0)
  6. tensorflow/compiler/mlir/quantization/tensorflow/passes/quantize_weights.cc

        }
        return success();
      }
    
     private:
      // Check if op's user or op's user after an identity op is connected to a
      // terminator.
      bool checkIfAnyUserIsConnectedToTermiantor(BlockArgument op) const {
        for (const auto& user : op.getUsers()) {
          if (user->template hasTrait<OpTrait::IsTerminator>()) return true;
          if (auto next_user = dyn_cast_or_null<TF::IdentityOp>(user)) {
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Tue Mar 05 07:39:40 UTC 2024
    - 11.3K bytes
    - Viewed (0)
  7. 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)
  8. 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)
  9. 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)
  10. 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)
Back to top