- Sort Score
- Result 10 results
- Languages All
Results 91 - 100 of 138 for getElementDtype (0.43 sec)
-
tensorflow/compiler/mlir/quantization/stablehlo/passes/fold_constant_transpose.cc
if (!const_op) return failure(); // Only support float tensors. auto tensor_type = mlir::dyn_cast_or_null<TensorType>(const_op.getType()); if (!tensor_type || !tensor_type.getElementType().isF32()) { return failure(); } return success( mlir::isa_and_nonnull<DenseFPElementsAttr>(const_op.getValue())); } void rewrite(mlir::stablehlo::TransposeOp op,
Registered: Sun Jun 16 05:45:23 UTC 2024 - Last Modified: Thu Apr 25 16:01:03 UTC 2024 - 7.7K bytes - Viewed (0) -
tensorflow/compiler/mlir/quantization/common/quantization_lib/quantization_driver.cc
if (auto dq_op = dyn_cast_or_null<quantfork::DequantizeCastOp>( op->getOperand(i).getDefiningOp())) { auto type = mlir::cast<TensorType>(dq_op.getArg().getType()).getElementType(); if (auto per_axis_qtype = mlir::dyn_cast_or_null<quant::UniformQuantizedPerAxisType>( QuantizedType::getQuantizedElementType(type))) { return true; } }
Registered: Sun Jun 16 05:45:23 UTC 2024 - Last Modified: Thu Apr 25 16:01:03 UTC 2024 - 38.1K bytes - Viewed (0) -
tensorflow/compiler/mlir/lite/transforms/optimize_functional_ops.cc
// TODO(hinsu): Handle constants that are not scalar booleans. auto cond_type = mlir::dyn_cast<RankedTensorType>(cond.getType()); if (!cond_type || !cond_type.getShape().equals({}) || !cond_type.getElementType().isInteger(/*width=*/1)) return failure(); // Identify the branch to inline. bool cond_value = (*cond.value_begin<APInt>()).getSExtValue(); func::FuncOp func = cond_value ? then_func : else_func;
Registered: Sun Jun 16 05:45:23 UTC 2024 - Last Modified: Thu Apr 25 16:01:03 UTC 2024 - 6.6K bytes - Viewed (0) -
tensorflow/compiler/mlir/lite/transforms/prepare_quantize.cc
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)) { need_to_set_input_nodes_quantization_params = true; break; } } if (!need_to_set_input_nodes_quantization_params) { return false; }
Registered: Sun Jun 16 05:45:23 UTC 2024 - Last Modified: Thu Apr 25 16:01:03 UTC 2024 - 17.6K bytes - Viewed (0) -
tensorflow/compiler/mlir/lite/transforms/prepare_quantize_dynamic_range.cc
QuantizationUnits& quantizable_ops) const { // Non-float tensors do not need quantization. auto type = mlir::dyn_cast<ShapedType>(op.getType()); if (!type || !type.getElementType().isF32()) return false; Value value = op.getResult(); // Check whether dynamic range quantization can be applied. for (auto& use : value.getUses()) { Operation* user = use.getOwner();
Registered: Sun Jun 16 05:45:23 UTC 2024 - Last Modified: Thu Apr 25 16:01:03 UTC 2024 - 20.8K bytes - Viewed (0) -
tensorflow/compiler/mlir/tensorflow/transforms/lift_variables.cc
auto arg_type = mlir::cast<RankedTensorType>(arg.getType()); assert(arg_type.getRank() == 0); llvm::ArrayRef<TensorType> underlying_type = mlir::cast<TF::ResourceType>(arg_type.getElementType()).getSubtypes(); // If the arg type already matches the global_tensor type, we don't need // to do anything. if (!underlying_type.empty() &&
Registered: Sun Jun 16 05:45:23 UTC 2024 - Last Modified: Thu May 23 09:05:47 UTC 2024 - 7.9K bytes - Viewed (0) -
tensorflow/compiler/mlir/tfrt/analysis/cost_analysis.cc
int64_t output_size = InferTensorSize(context, value_type); int64_t cost = kLookupTableFindCostScale * output_size; if (mlir::isa<mlir::TF::StringType>(key_type.getElementType())) cost *= kLookupTableFindStringKeyCostScale; return cost; } // The cost function for tf.GatherV2. int64_t InferGatherV2Cost(const CostContext& context, mlir::TF::GatherV2Op op) {
Registered: Sun Jun 16 05:45:23 UTC 2024 - Last Modified: Thu Apr 25 16:01:03 UTC 2024 - 7.6K bytes - Viewed (0) -
tensorflow/compiler/mlir/lite/stablehlo/transforms/op_stat_pass.cc
ShapedType value_shaped_type = mlir::dyn_cast_or_null<ShapedType>( value_for_deducing_op_type.getType()); if (value_shaped_type != nullptr) { auto operand_or_result = value_shaped_type.getElementType(); std::string dtype; TypeSwitch<Type>(operand_or_result) .Case<IntegerType>([&](Type) { dtype =
Registered: Sun Jun 16 05:45:23 UTC 2024 - Last Modified: Thu Apr 25 16:01:03 UTC 2024 - 8.7K bytes - Viewed (0) -
tensorflow/compiler/mlir/tensorflow/utils/xla_sharding_util.cc
split_dimension, num_split)); } shape[split_dimension] = shape[split_dimension] / num_split; output_type = mlir::RankedTensorType::get(shape, input_type.getElementType()); } } else { output_type = input_type; } // Creates a split op that splits |src_input| along |split_dimension|. llvm::SmallVector<mlir::Type, 4> output_types(num_split, output_type);
Registered: Sun Jun 16 05:45:23 UTC 2024 - Last Modified: Wed May 22 21:28:13 UTC 2024 - 34K bytes - Viewed (0) -
tensorflow/compiler/mlir/tensorflow/transforms/constant_fold_utils.cc
// require "raising" later. for (const Type type : inst->getResultTypes()) { if (const TensorType tensor_type = mlir::dyn_cast<TensorType>(type)) { if (mlir::isa<VariantType>(tensor_type.getElementType())) { return false; } } } // Operations that execute function calls shouldn't be constant folded. if (llvm::isa<TF::WhileOp, TF::CaseOp, TF::IfOp, CallOpInterface>(inst)) {
Registered: Sun Jun 16 05:45:23 UTC 2024 - Last Modified: Thu Apr 25 16:01:03 UTC 2024 - 7.3K bytes - Viewed (0)