Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 9 of 9 for FailureOr (0.16 sec)

  1. tensorflow/compiler/mlir/quantization/tensorflow/cc/convert_asset_args_test.cc

            return
          }
        }
      )mlir");
    
      FailureOr<SmallVector<AssetFileDef>> asset_file_defs =
          ConvertAssetArgs(*module_op);
    
      EXPECT_TRUE(succeeded(asset_file_defs));
      EXPECT_THAT(*asset_file_defs, SizeIs(1));
    
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 6.2K bytes
    - Viewed (0)
  2. tensorflow/compiler/mlir/quantization/common/attrs_and_constraints.cc

        return failure();
      }
      return static_cast<int32_t>(value);
    }
    
    FailureOr<SmallVector<int32_t>> CastI64ArrayToI32(
        const ArrayRef<int64_t> int64_array) {
      SmallVector<int32_t> int32_array{};
      int32_array.reserve(int64_array.size());
    
      for (const int64_t i64 : int64_array) {
        FailureOr<int32_t> cast_i32 = CastI64ToI32(i64);
        if (failed(cast_i32)) return failure();
    
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 6.8K bytes
    - Viewed (0)
  3. tensorflow/compiler/mlir/tensorflow/transforms/xla_call_module_serialization.cc

    constexpr llvm::StringRef kCalledIndexAttrName = "called_index";
    constexpr llvm::StringRef kCalledFuncAttrName = "called_func";
    
    // Converts `called_func` attributes in custom call ops back to `called_index`.
    FailureOr<ArrayAttr> DesymbolizeCustomCallCalledIndex(ModuleOp module) {
      Builder builder(module.getContext());
    
      SmallVector<Attribute> function_list;
      llvm::DenseMap<SymbolRefAttr, int> called_indexes;
    
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 9.5K bytes
    - Viewed (0)
  4. tensorflow/compiler/mlir/tensorflow/transforms/shape_inference.h

    // Returns a failure() on error, otherwise returns true to indicate that it
    // reached convergence, false otherwise.
    // If input shapes are provided, first refines the `main` function using
    // InferShapeForFunction.
    FailureOr<bool> InferModuleShape(ModuleOp module, int64_t max_iterations = 10,
                                     ArrayRef<TypeID> ops_to_skip = {},
                                     ArrayRef<ArrayRef<int64_t>> input_shapes = {});
    
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Wed Apr 24 12:49:45 UTC 2024
    - 3.5K bytes
    - Viewed (0)
  5. tensorflow/compiler/mlir/tensorflow/transforms/set_tpu_infeed_layout.cc

    #include "xla/shape.h"
    #include "xla/stream_executor/tpu/c_api_conversions.h"
    #include "xla/stream_executor/tpu/tpu_api.h"
    #include "xla/translate/mhlo_to_hlo/type_to_shape.h"
    
    namespace mlir {
    
    static FailureOr<std::vector<int64_t>> GetTPUInfeedLayoutFromAPI(
        RankedTensorType t) {
      // Call the TPU API to determine the right infeed layout. Note that
      // this can fail if we're not running on a TPU-enabled node.
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 6.1K bytes
    - Viewed (0)
  6. tensorflow/compiler/mlir/tensorflow/utils/stablehlo_custom_call.cc

      return op.getCallTargetName() == kTfTargetName;
    }
    
    DictionaryAttr GetTfBackendConfig(stablehlo::CustomCallOp op) {
      return op->getAttrOfType<DictionaryAttr>(kTfBackendConfigAttrName);
    }
    
    FailureOr<SymbolRefAttr> GetTfFuncCustomCallFuncName(
        stablehlo::CustomCallOp op) {
      if (!IsTfFuncCustomCall(op)) {
        return success(nullptr);
      }
    
      auto config = GetTfBackendConfig(op);
      if (config == nullptr) {
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 2.6K bytes
    - Viewed (0)
  7. tensorflow/compiler/mlir/quantization/stablehlo/passes/lift_quantizable_spots_as_functions.cc

      std::unique_ptr<RE2> match_regex_;  // NOLINT
    };
    
    // Converts `Method` to a single-line textproto representation. Returns
    // `failure()` when converting to textproto failed.
    FailureOr<std::string> QuantizationMethodToTextProto(const Method& method) {
      TextFormat::Printer printer;
      printer.SetSingleLineMode(true);
    
      std::string method_txtpb;
      if (!printer.PrintToString(method, &method_txtpb)) {
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Fri May 10 04:07:09 UTC 2024
    - 9.3K bytes
    - Viewed (0)
  8. tensorflow/compiler/mlir/quantization/stablehlo/utils/tf_type_utils.cc

            return IntegerType::get(type.getContext(), 16,
                                    IntegerType::SignednessSemantics::Unsigned);
          })
          .Default([&type](Type) { return type; });
    }
    
    FailureOr<mlir::DenseElementsAttr> GetDenseAttrFromTensorProtoAttr(
        const llvm::StringRef mangled_tensor_proto, TensorType tensor_type) {
      ::tensorflow::TensorProto tensor_proto;
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 4.1K bytes
    - Viewed (0)
  9. tensorflow/compiler/mlir/quantization/tensorflow/cc/convert_asset_args.cc

      SmallVector<NamedAttribute> new_arg_attrs =
          ReplaceBoundInputAttrWithIndexPathAttr(arg_attrs, index_path, builder);
    
      main_func_op.setArgAttrs(arg_idx, new_arg_attrs);
    }
    
    }  // namespace
    
    FailureOr<SmallVector<AssetFileDef>> ConvertAssetArgs(ModuleOp module_op) {
      func::FuncOp main_func_op = FindMainFuncOp(module_op);
      if (!main_func_op) return failure();
    
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 5.4K bytes
    - Viewed (0)
Back to top