Search Options

Results per page
Sort
Preferred Languages
Advance

Results 91 - 100 of 139 for getElementDtype (0.45 sec)

  1. tensorflow/compiler/mlir/quantization/tensorflow/passes/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.2K bytes
    - Viewed (0)
  2. 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)
  3. tensorflow/compiler/mlir/lite/stablehlo/transforms/optimize_layout.cc

      SmallVector<int64_t, 4> permutedShape = applyPermutation(
          type.getShape(), isInvert ? invertPermutationVector(perm) : perm);
      return RankedTensorType::get(permutedShape, type.getElementType());
    }
    
    static RankedTensorType GetInvertPermutedTensorType(RankedTensorType type,
                                                        ArrayRef<int64_t> perm) {
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 21:59:06 UTC 2024
    - 8.6K bytes
    - Viewed (0)
  4. 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)
  5. 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)
  6. 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)
  7. 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)
  8. 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)
  9. 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)
  10. 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)
Back to top