Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 15 for getValueAsDouble (0.45 sec)

  1. tensorflow/compiler/mlir/lite/quantization/device_target.cc

      output_ranges->push_back(CalculateQuantizedRange(
          o_spec.getScale(), o_spec.getZeroPoint(),
          (min ? std::optional<double>(min.getValueAsDouble()) : std::nullopt),
          (max ? std::optional<double>(max.getValueAsDouble()) : std::nullopt),
          o_spec.getStorageTypeMin(), o_spec.getStorageTypeMax()));
    
      return success();
    }
    
    LogicalResult DeviceTarget::DecomposeSameScale(
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Fri Mar 08 10:41:08 UTC 2024
    - 7.3K bytes
    - Viewed (0)
  2. tensorflow/compiler/mlir/quantization/tensorflow/passes/convert_custom_aggregation_op_to_quant_stats.cc

        ElementsAttr layer_stats = DenseFPElementsAttr::get(
            RankedTensorType::get({2}, rewriter.getF32Type()),
            {static_cast<float>(min.getValueAsDouble()),
             static_cast<float>(max.getValueAsDouble())});
        ElementsAttr axis_stats;
        IntegerAttr axis;
    
        quantfork::StatisticsOp stats_op = rewriter.create<quantfork::StatisticsOp>(
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 4.8K bytes
    - Viewed (0)
  3. tensorflow/compiler/mlir/lite/quantization/ir/ConvertSimQuant.cc

        min.reserve(fqOp.getMin().size());
        max.reserve(fqOp.getMax().size());
        for (auto m : fqOp.getMin())
          min.push_back(cast<FloatAttr>(m).getValueAsDouble());
        for (auto m : fqOp.getMax())
          max.push_back(cast<FloatAttr>(m).getValueAsDouble());
    
        return fakeQuantAttrsToType(fqOp.getLoc(), fqOp.getNumBits(),
                                    fqOp.getAxis(), min, max, fqOp.getNarrowRange(),
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Wed May 08 02:10:16 UTC 2024
    - 6K bytes
    - Viewed (0)
  4. tensorflow/compiler/mlir/lite/experimental/tac/common/cost.h

    inline bool GetCostOnOp(Operation* op, float* cost) {
      auto cost_type = op->getAttrOfType<FloatAttr>(kCost);
      if (cost_type == nullptr) {
        return false;
      }
    
      *cost = cost_type.getValueAsDouble();
      return true;
    }
    
    }  // namespace tac
    }  // namespace TFL
    }  // namespace mlir
    
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Wed Jul 21 01:22:53 UTC 2021
    - 1.6K bytes
    - Viewed (0)
  5. tensorflow/compiler/mlir/quantization/common/quantization_lib/quantization_utils.cc

          min_value.push_back(FloatAttr::getValueAsDouble(*it));
        }
        for (auto it = maxs.begin(); it != maxs.end(); ++it) {
          max_value.push_back(FloatAttr::getValueAsDouble(*it));
        }
      } else {
        const auto fmin = dyn_cast<FloatAttr>(min);
        const auto fmax = dyn_cast<FloatAttr>(max);
        if (fmin && fmax) {
          min_value.push_back(fmin.getValueAsDouble());
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Wed May 08 02:10:16 UTC 2024
    - 43.2K bytes
    - Viewed (0)
  6. tensorflow/compiler/mlir/lite/stablehlo/transforms/legalize_stablehlo_composite_to_tfl_custom.cc

        fbb->Int(key, mlir::dyn_cast<mlir::IntegerAttr>(attr).getInt());
        return success();
      }
    
      if (mlir::isa<::mlir::FloatAttr>(attr)) {
        fbb->Double(key, mlir::dyn_cast<mlir::FloatAttr>(attr).getValueAsDouble());
        return success();
      }
    
      return op->emitWarning("serialization not supported for : ") << key;
    }
    
    TFL::CustomOp BuildCustomOp(stablehlo::CompositeOp composite,
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 6.8K bytes
    - Viewed (0)
  7. tensorflow/compiler/mlir/lite/transforms/prepare_quantize_helper.h

          stats_op.emitError("Stats should have 2 values.");
          return failure();
        }
        quant::QuantizedType quant_type;
        double min = FloatAttr::getValueAsDouble(stats.getValues<APFloat>()[0]);
        double max = FloatAttr::getValueAsDouble(stats.getValues<APFloat>()[1]);
        // Make sure the range includes zero.
        min = std::min(min, 0.0);
        max = std::max(max, 0.0);
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Fri May 03 18:01:23 UTC 2024
    - 28K bytes
    - Viewed (0)
  8. tensorflow/compiler/mlir/quantization/common/quantization_lib/quantization_utils.h

          if (!stats) return failure();
    
          for (auto it = stats.begin(), e = stats.end(); it != e; ++it) {
            double rmin = FloatAttr::getValueAsDouble(*it++);
            double rmax = FloatAttr::getValueAsDouble(*it);
            // The default nudging implementation of mlir quant library might cause
            // clamping during inference if the calibration range isn't wide enough.
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Wed Apr 24 20:30:06 UTC 2024
    - 41.7K bytes
    - Viewed (0)
  9. tensorflow/compiler/mlir/lite/experimental/tac/execution_metadata_exporter.cc

        auto cost_attr = device_costs_attr.getNamed(kv.first);
        if (!cost_attr.has_value()) return std::nullopt;
        float cost = mlir::dyn_cast_or_null<mlir::FloatAttr>(cost_attr->getValue())
                         .getValueAsDouble();
        device_costs[kv.second] = cost;
      }
      return device_costs;
    }
    
    flatbuffers::Offset<SubgraphMetadata> CreateSubgraphMetadata(
        const std::map<std::string, uint8_t>& hardware_map, mlir::Region* Region,
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Tue Jun 11 06:11:34 UTC 2024
    - 7.5K bytes
    - Viewed (0)
  10. tensorflow/compiler/mlir/tensorflow/utils/export_utils.cc

      value->set_i(attr.getInt());
      return absl::OkStatus();
    }
    
    Status ConvertAttribute(const mlir::FloatAttr& attr, AttrValue* value) {
      value->set_f(attr.getValueAsDouble());
      return absl::OkStatus();
    }
    
    Status ConvertAttribute(const mlir::ElementsAttr& attr, AttrValue* value) {
      return ConvertToTensorProto(attr, value->mutable_tensor());
    }
    
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Fri May 17 17:58:54 UTC 2024
    - 19.7K bytes
    - Viewed (0)
Back to top