Search Options

Results per page
Sort
Preferred Languages
Advance

Results 71 - 80 of 101 for getAttrOfType (0.22 sec)

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

        // contain the attribute names.
        // TransferQuantizationAttributes(rewriter, inner_op, attrs);
        std::string attr_map_str =
            inner_op.getAttrOfType<StringAttr>(kAttrMapAttribute).str();
        for (absl::string_view element_str : absl::StrSplit(attr_map_str, ',')) {
          std::vector<absl::string_view> key_and_value_pair =
              absl::StrSplit(element_str, ':');
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 54.5K bytes
    - Viewed (0)
  2. tensorflow/compiler/mlir/lite/transforms/prepare_quantize_helper.h

    // index.
    template <typename LstmOp>
    inline QuantizedType GetIntermediateElementType(LstmOp op, int tensor_index) {
      if (tensor_index < 0 || tensor_index > 4) return nullptr;
      TypeAttr attr = op->template getAttrOfType<TypeAttr>(
          intermediate_attributes[tensor_index]);
      if (!attr) {
        return nullptr;
      }
      return QuantizedType::getQuantizedElementType(attr.getValue());
    }
    
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Fri May 03 18:01:23 UTC 2024
    - 28K bytes
    - Viewed (0)
  3. tensorflow/compiler/mlir/tensorflow/transforms/xla_call_module_deserialization.cc

          module.walk([&](stablehlo::CustomCallOp op) {
            if (!IsTfFuncCustomCall(op)) {
              return WalkResult::advance();
            }
    
            auto backend_config =
                op->getAttrOfType<DictionaryAttr>(kTfBackendConfigAttrName);
            if (!backend_config) {
              op->emitOpError()
                  << "is missing attribute '" << kTfBackendConfigAttrName << "'";
              return WalkResult::interrupt();
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu May 23 09:05:47 UTC 2024
    - 11.1K bytes
    - Viewed (0)
  4. tensorflow/compiler/mlir/tensorflow/utils/device_util_test.cc

      DeviceSet device_set;
      for (auto& device : devices) device_set.AddDevice(device.get());
      AddDevicesToOp(*module_ref, &device_set);
    
      auto devices_attr =
          (*module_ref)->getAttrOfType<mlir::DictionaryAttr>("tf.devices");
      ASSERT_NE(devices_attr, nullptr);
      ASSERT_EQ(devices_attr.size(), 3);
    
      // CPU device added with an empty metadata.
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 9.5K bytes
    - Viewed (0)
  5. tensorflow/compiler/mlir/tensorflow/transforms/sparsecore/embedding_sequencing.cc

    }
    
    StringAttr GetReplicationAttr(mlir::Operation* op) {
      return op->getAttrOfType<StringAttr>(TF::kReplicationInfoAttr);
    }
    
    StringAttr GetReplicationAttr(TF::TPUCompilationResultOp op) {
      // Special case for getting the replication region for
      // TPUCompilationResultsOp.
      return op->getAttrOfType<StringAttr>(kTpuCompilationStatus);
    }
    
    int64_t GetNumOps(func::FuncOp func) {
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 39.4K bytes
    - Viewed (0)
  6. tensorflow/compiler/mlir/tensorflow/translate/tf_mlir_translate.cc

      for (auto fn : module->getOps<mlir::func::FuncOp>()) {
        for (auto& bb : fn) {
          for (auto& inst : bb) {
            auto attr_id = mlir::StringAttr::get(context, "value");
            if (auto attr = inst.getAttrOfType<mlir::ElementsAttr>(attr_id)) {
              mlir::Attribute rand_val;
              mlir::Type element_type = attr.getShapedType().getElementType();
              if (mlir::isa<mlir::IntegerType>(element_type)) {
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Tue May 07 11:51:44 UTC 2024
    - 14.1K bytes
    - Viewed (0)
  7. tensorflow/compiler/mlir/tensorflow/transforms/tpu_dynamic_layout_pass.cc

          device = func.getArgAttrOfType<mlir::StringAttr>(arg.getArgNumber(),
                                                           kFuncDeviceAttr);
        } else {
          device = alias.getDefiningOp()->getAttrOfType<StringAttr>(kDeviceAttr);
        }
    
        if (!device) return false;
        tensorflow::DeviceNameUtils::ParsedName parsed_device;
        if (!tensorflow::DeviceNameUtils::ParseFullName(device.getValue().str(),
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 12.7K bytes
    - Viewed (0)
  8. tensorflow/compiler/mlir/lite/flatbuffer_export.cc

      FuncOp main_fn = module.lookupSymbol<FuncOp>("main");
      if (!main_fn) {
        int entry_func_count = 0;
        for (auto fn : module.getOps<FuncOp>()) {
          auto attrs = fn->getAttrOfType<mlir::DictionaryAttr>("tf.entry_function");
          if (attrs && !attrs.empty()) {
            ++entry_func_count;
          }
        }
    
        // Verify that module has a least one enrty function.
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Wed Jun 12 21:41:49 UTC 2024
    - 164.5K bytes
    - Viewed (0)
  9. tensorflow/compiler/mlir/tf2xla/transforms/legalize_tf_collective.cc

    LogicalResult SetOnceModuleAttribute(StringRef attr_name,
                                         IntegerAttr attr_value, Operation* op,
                                         ModuleOp& module) {
      const auto ex_attr_value = module->getAttrOfType<IntegerAttr>(attr_name);
      if (ex_attr_value == nullptr) {
        module->setAttr(attr_name, attr_value);
        return success();
      }
      if (ex_attr_value == attr_value) {
        return success();
      }
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 16K bytes
    - Viewed (0)
  10. tensorflow/compiler/mlir/tensorflow/transforms/fused_kernel_matcher.cc

        return success();
      }
    };
    
    const char kDeviceAttr[] = "device";
    const char kDeviceGpu[] = "GPU";
    
    std::optional<std::string> GetDevice(mlir::Operation *op) {
      mlir::StringAttr device = op->getAttrOfType<mlir::StringAttr>(kDeviceAttr);
      if (!device || device.getValue().empty()) {
        return std::nullopt;
      }
      const std::string device_name = device.str();
      tensorflow::DeviceNameUtils::ParsedName parsed_name;
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 14.9K bytes
    - Viewed (0)
Back to top