Search Options

Results per page
Sort
Preferred Languages
Advance

Results 21 - 30 of 30 for constant_ops (0.14 sec)

  1. tensorflow/compiler/mlir/lite/transforms/legalize_jax_random.cc

        result_shape_i32.push_back(static_cast<int32_t>(element));
      }
      auto result_shape_attr = builder.getI32TensorAttr(result_shape_i32);
      Value result_shape_tensor =
          builder.create<stablehlo::ConstantOp>(result_shape_attr);
      auto custom_code =
          IsJaxRandomUniform(func) ? "RandomUniform" : "RandomStandardNormal";
    
      llvm::SmallVector<Type> result_ty_vec({result_ty});
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 5.1K bytes
    - Viewed (0)
  2. tensorflow/compiler/mlir/quantization/stablehlo/passes/unwrap_xla_call_module_op.cc

      // TODO: b/310291615 - find a better way for multi-platform support.
      if (call_op_has_platform_index_arg) {
        arg_mapper.map(func_op.getArgument(0),
                       builder.create<mhlo::ConstantOp>(
                           func_op.getLoc(), builder.getI16IntegerAttr(0)));
      }
      for (auto [func_arg, operand] : llvm::zip_equal(
               func_op.getArguments().take_back(call_op.getNumOperands()),
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Tue Mar 05 07:39:40 UTC 2024
    - 4.8K bytes
    - Viewed (0)
  3. tensorflow/compiler/mlir/quantization/stablehlo/passes/post_quantize.cc

          const Type qtype = op.getResult().getType();
          ElementsAttr quantized_attr = Quantize(attr, qtype);
          if (quantized_attr) {
            rewriter.replaceOpWithNewOp<mlir::stablehlo::ConstantOp>(
                op, qtype, quantized_attr);
            return success();
          }
        }
        return failure();
      }
    };
    
    // Replaces quantfork.dcast with stablehlo.uniform_dequantize.
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Tue Mar 05 07:39:40 UTC 2024
    - 6.3K bytes
    - Viewed (0)
  4. tensorflow/compiler/mlir/lite/stablehlo/transforms/legalize_hlo_conversions/reduce.h

        int64_t axis = reduce_op.getDimensions().getValues<int64_t>()[0];
    
        auto dim_type = RankedTensorType::get({1}, rewriter.getI32Type());
        auto reduction_indices = rewriter.create<arith::ConstantOp>(
            reduce_op.getLoc(), dim_type,
            rewriter.getI32TensorAttr({static_cast<int32_t>(axis)}));
    
        // Generate a Max and an ArgMax of as the mhlo op returns both while in TF
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 5.7K bytes
    - Viewed (0)
  5. tensorflow/compiler/mlir/quantization/common/quantization_lib/quantization_driver_test.cc

          /*infer_tensor_range=*/true, /*legacy_float_scale=*/false,
          /*is_qdq_conversion=*/false);
    
      quantization_driver.Initialize();
    
      int64_t num_constant_op = 0;
      main_fn.walk([&](arith::ConstantOp cst) { ++num_constant_op; });
      EXPECT_EQ(num_constant_op, 4);
    }
    
    TEST_F(ApplyQuantizationParamsPropagationTest,
           PropagateParamsCreatesQuantState) {
      const OwningOpRef<ModuleOp> module_op_ref =
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 7.9K bytes
    - Viewed (0)
  6. tensorflow/compiler/mlir/tensorflow/transforms/initialize_variables_in_session_init.cc

      builder.setInsertionPointToStart(&session_init_func.getBlocks().front());
      auto var_handle_op_in_init = var_handle_op->clone();
      builder.insert(var_handle_op_in_init);
      auto const_op = builder.create<mlir::arith::ConstantOp>(
          session_init_func.getLoc(), tensor_attr.getType(), tensor_attr);
    
      builder.create<TF::AssignVariableOp>(
          session_init_func.getLoc(), llvm::ArrayRef<mlir::Type>{},
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu May 23 09:05:47 UTC 2024
    - 7K bytes
    - Viewed (0)
  7. tensorflow/compiler/mlir/quantization/common/attrs_and_constraints.td

    def DefaultOrNullAttr : NativeCodeCall<"DefaultOrNullAttr($_builder, $0)">;
    
    // Returns true if the given op is a StableHLO constant op.
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Fri Mar 08 04:55:44 UTC 2024
    - 6.7K bytes
    - Viewed (0)
  8. tensorflow/compiler/mlir/lite/experimental/tac/execution_metadata_exporter.cc

    #include "tensorflow/compiler/mlir/tensorflow/ir/tf_ops.h"
    
    namespace tflite {
    namespace {
    
    bool IsConst(mlir::Operation* op) {
      return llvm::isa<mlir::arith::ConstantOp, mlir::TF::ConstOp,
                       mlir::TFL::ConstOp, mlir::TFL::QConstOp>(op);
    }
    
    bool IsOpSupported(mlir::Operation* op, const std::string& hardware) {
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Tue Jun 11 06:11:34 UTC 2024
    - 7.5K bytes
    - Viewed (0)
  9. tensorflow/compiler/mlir/lite/debug/debug_test.cc

        func->setAttr("tfl.func", builder.getUnitAttr());
        builder.setInsertionPointToStart(func.addEntryBlock());
        llvm::SmallVector<int> shape{1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
        builder.create<mlir::arith::ConstantOp>(
            builder.getUnknownLoc(),
            mlir::DenseIntElementsAttr::get(
                mlir::RankedTensorType::get(shape.size(), builder.getI32Type()),
                shape));
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Wed Apr 17 11:15:16 UTC 2024
    - 9.7K bytes
    - Viewed (0)
  10. tensorflow/compiler/mlir/lite/transforms/optimize_batch_matmul.cc

          // mapped to X and Z dimension.
          std::iter_swap(permute.begin() + input_rank - 1,
                         permute.begin() + input_rank - 2);
          auto permutation_tensor_op = rewriter.create<arith::ConstantOp>(
              bmm_op->getLoc(), permuation_tensor_type,
              DenseElementsAttr::get(permuation_tensor_type, permute));
    
          auto input_shape = input_type.getShape();
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 9.6K bytes
    - Viewed (0)
Back to top