Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 62 for getAttrOfType (0.23 sec)

  1. tensorflow/compiler/mlir/tensorflow/transforms/tpu_colocate_splits.cc

        if (auto split = llvm::dyn_cast<TF::SplitOp>(op)) {
          if (HasDevice(split) || split->getAttrOfType<ArrayAttr>(kClassAttr))
            return WalkResult::advance();
          for (Operation* pred : IslandPredecessors(split)) {
            if (auto colocation_classes =
                    pred->getAttrOfType<ArrayAttr>(kClassAttr)) {
              split->setAttr(kClassAttr, colocation_classes);
              return WalkResult::advance();
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 27 18:44:34 UTC 2023
    - 2.8K bytes
    - Viewed (0)
  2. tensorflow/compiler/mlir/tensorflow/transforms/tf_device_assignment.cc

      void runOnOperation() override {
        Builder builder(&getContext());
        Dialect* tf = getContext().getLoadedDialect<TensorFlowDialect>();
        getOperation().walk([&](Operation* op) {
          if (auto device_attr = op->getAttrOfType<StringAttr>(kDeviceAttr)) {
            // We assign default device to ops with device attribute that is empty.
            if (device_attr.getValue().empty()) {
              op->setAttr(kDeviceAttr, builder.getStringAttr(default_device_));
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Wed Oct 05 23:50:19 UTC 2022
    - 4.3K bytes
    - Viewed (0)
  3. tensorflow/compiler/mlir/tensorflow/transforms/replica_id_to_device_ordinal.cc

        // attribute modulo the number of TPU cores in the system.
        for (auto op : require_device_ordinal_ops) {
          if (op->getAttrOfType<IntegerAttr>(kDeviceOrdinalAttr).getInt() == -1) {
            OpBuilder builder(op);
            int device_ordinal =
                op->getAttrOfType<IntegerAttr>(kReplicaIdAttr).getInt() %
                device_num;
            op->setAttr(kDeviceOrdinalAttr,
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Wed Oct 05 23:50:19 UTC 2022
    - 4K bytes
    - Viewed (0)
  4. tensorflow/compiler/mlir/tensorflow/utils/attribute_utils.cc

    namespace mlir {
    namespace TF {
    
    using ::tensorflow::kValidDeviceTypes;
    
    LogicalResult HasValidCompilationAndReplicationAttributes(Operation& op) {
      auto replicate_attr = op.getAttrOfType<StringAttr>(kReplicationInfoAttr);
      auto compile_attr = op.getAttrOfType<StringAttr>(kCompileDeviceTypeAttr);
      if (!replicate_attr && !compile_attr) return success();
      if (!replicate_attr || !compile_attr)
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu May 02 22:03:30 UTC 2024
    - 3.8K bytes
    - Viewed (0)
  5. tensorflow/compiler/mlir/tensorflow/transforms/tensor_device_copy_conversion.cc

          }
        } else if (StringAttr attr = arg.getDefiningOp()->getAttrOfType<StringAttr>(
                       kDeviceAttr)) {
          return op_device == attr;
        }
        // Fold tf.Identity when arg device is not defined.
        return true;
      };
    
      func_op.walk([&should_fold_op_func](TF::IdentityOp op) {
        StringAttr op_device = op->getAttrOfType<StringAttr>(kDeviceAttr);
        if (should_fold_op_func(op.getOperand(), op_device)) {
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 4.3K bytes
    - Viewed (0)
  6. tensorflow/compiler/mlir/lite/quantization/device_target.cc

      double real_multiplier = scale_product / o_spec.getScale();
      output_multipliers->push_back(QuantizeMultiplier(real_multiplier));
    
      // output ranges
      auto min = rop->getAttrOfType<FloatAttr>("min");
      auto max = rop->getAttrOfType<FloatAttr>("max");
      output_ranges->push_back(CalculateQuantizedRange(
          o_spec.getScale(), o_spec.getZeroPoint(),
          (min ? std::optional<double>(min.getValueAsDouble()) : std::nullopt),
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Fri Mar 08 10:41:08 UTC 2024
    - 7.3K bytes
    - Viewed (0)
  7. tensorflow/compiler/mlir/tensorflow/transforms/readonly_references_to_resources.cc

      StringAttr shared_name_attr = op->getAttrOfType<StringAttr>(kSharedNameAttr);
      if (shared_name_attr) {
        auto shared_name = StringRef(shared_name_attr.getValue());
        if (!shared_name.empty()) {
          return shared_name;
        }
      }
      // Attempt to parse "_class" attribute if there is no "shared_name"
      // attribute.
      ArrayAttr classes_attr = op->getAttrOfType<ArrayAttr>(kClassAttr);
      if (!classes_attr) {
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 7.8K bytes
    - Viewed (0)
  8. tensorflow/compiler/mlir/tensorflow/ir/host_runtime/tfrt_ops.cc

      // The sizes of indices, shared_name and container must be equal.
      int32_t indices_size =
          get_resource_op->getAttrOfType<mlir::ArrayAttr>("indices").size();
      int32_t shared_name_size =
          get_resource_op->getAttrOfType<mlir::ArrayAttr>("shared_name").size();
      int32_t container_size =
          get_resource_op->getAttrOfType<mlir::ArrayAttr>("container").size();
    
      if (!(indices_size == shared_name_size &&
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 5.6K bytes
    - Viewed (0)
  9. tensorflow/compiler/mlir/tensorflow/transforms/hoist_loop_invariant.cc

    ResourceHandle GetResourceHandle(Operation *op) {
      llvm::StringRef device;
      if (auto attr = op->getAttrOfType<StringAttr>("device")) {
        device = attr.getValue();
      }
    
      llvm::StringRef container;
      if (auto attr = op->getAttrOfType<StringAttr>("container")) {
        container = attr.getValue();
      }
    
      llvm::StringRef shared_name;
      if (auto attr = op->getAttrOfType<StringAttr>("shared_name")) {
        shared_name = attr.getValue();
      }
    
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 5.3K bytes
    - Viewed (0)
  10. tensorflow/compiler/mlir/tensorflow/utils/translate_utils.cc

    }
    
    mlir::LogicalResult ExtractTfVersions(mlir::ModuleOp module,
                                          VersionDef* versions) {
      versions->Clear();
      auto version_attr =
          module->getAttrOfType<mlir::DictionaryAttr>("tf.versions");
      if (!version_attr) return mlir::failure();
    
      auto producer =
          mlir::dyn_cast_or_null<mlir::IntegerAttr>(version_attr.get("producer"));
      if (!producer) return mlir::failure();
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Fri Apr 26 09:37:10 UTC 2024
    - 3.2K bytes
    - Viewed (0)
Back to top