Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 77 for constant_ops (0.26 sec)

  1. tensorflow/compiler/mlir/tensorflow/transforms/init_text_file_to_import_test_pass.cc

      MLIRContext* context = &getContext();
    
      for (func::FuncOp func : module.getOps<func::FuncOp>()) {
        llvm::SmallVector<arith::ConstantOp, 4> constant_ops(
            func.getOps<arith::ConstantOp>());
        for (auto op : constant_ops) {
          ShapedType shaped_type =
              RankedTensorType::get({1}, StringType::get(context));
    
          DenseStringElementsAttr attr;
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Tue Oct 04 09:19:38 UTC 2022
    - 5.5K bytes
    - Viewed (0)
  2. tensorflow/compiler/mlir/quantization/stablehlo/utils/stablehlo_type_utils_test.cc

      const OwningOpRef<mlir::stablehlo::ConstantOp> constant_op =
          builder_.create<mlir::stablehlo::ConstantOp>(
              builder_.getUnknownLoc(), builder_.getI32IntegerAttr(0));
      EXPECT_TRUE(IsStablehloOp(*constant_op));
    }
    
    TEST_F(StablehloTypeUtilsTest, IsStablehloOpFailsWithArithOp) {
      const OwningOpRef<mlir::arith::ConstantOp> constant_op =
          builder_.create<mlir::arith::ConstantOp>(builder_.getUnknownLoc(),
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Mon Mar 25 00:32:20 UTC 2024
    - 2.1K bytes
    - Viewed (0)
  3. tensorflow/compiler/mlir/quantization/common/attrs_and_constraints_test.cc

      ASSERT_FALSE(module_op->getBodyRegion().empty());
      ASSERT_FALSE(module_op->getBodyRegion().front().empty());
    
      auto constant_op = dyn_cast_or_null<mlir::stablehlo::ConstantOp>(
          module_op->getBodyRegion().front().front());
      ASSERT_THAT(constant_op, NotNull());
    
      EXPECT_TRUE(HasRankOf(constant_op, /*rank=*/4));
    }
    
    TEST_F(AttrsAndConstraintsTest, HasRankOfReturnsFalseForNonMatchingRank) {
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Tue May 14 17:10:32 UTC 2024
    - 22.9K bytes
    - Viewed (0)
  4. tensorflow/compiler/mlir/quantization/stablehlo/passes/replace_stablehlo_ops_in_main_function_with_xla_call_module_ops.cc

        // while not too large to possibly significantly increase model size.
        if (constant_op.getValue().getNumElements() > 32) continue;
        while (!constant_op.getResult().hasOneUse()) {
          auto new_constant_op = builder.clone(*constant_op.getOperation());
          constant_op.getResult().getUses().begin()->assign(
              dyn_cast<mlir::stablehlo::ConstantOp>(new_constant_op));
        }
      }
    }
    
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 21K bytes
    - Viewed (0)
  5. tensorflow/compiler/mlir/quantization/common/quantization_lib/quantization_driver.cc

        quantized_.insert(op);
    
        if (auto constant_op = dyn_cast<arith::ConstantOp>(op); constant_op) {
          // If the workflow requires inferring ranges from the content
          // (post-training quantization) and it is weight (filter) and hasn't
          // been quantized, we infer the quantization parameters from the content.
          if (infer_tensor_range_ && IsWeight(constant_op) && !IsQuantized(op)) {
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 38.1K bytes
    - Viewed (0)
  6. tensorflow/compiler/mlir/lite/stablehlo/transforms/uniform_quantized_stablehlo_to_tfl_pass.cc

    class RewriteQuantizedConstantOp
        : public OpRewritePattern<stablehlo::ConstantOp> {
     public:
      using OpRewritePattern<stablehlo::ConstantOp>::OpRewritePattern;
    
      LogicalResult match(stablehlo::ConstantOp op) const override {
        return success(IsQuantizedTensorType(op.getOutput().getType()));
      }
    
      void rewrite(stablehlo::ConstantOp op,
                   PatternRewriter& rewriter) const override {
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Mon Apr 22 09:00:19 UTC 2024
    - 99.8K bytes
    - Viewed (0)
  7. tensorflow/compiler/mlir/tfr/integration/node_expansion_test.py

      def testBiasedDense(self):
        t1 = constant_op.constant([[1.0, 2.0], [3.0, 4.0]])
        t2 = constant_op.constant([[1.0, 2.0], [3.0, 4.0]])
        t3 = constant_op.constant([[-10.0, -10.0], [-10.0, -10.0]])
        sq = gen_composite_ops.my_biased_dense(t1, t2, t3)
        self.assertAllEqual(sq.numpy().reshape(-1), [-3, 0, 5, 12])
    
      def testBiasedDenseRelu(self):
        t1 = constant_op.constant([[1.0, 2.0], [3.0, 4.0]])
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Tue Sep 28 21:37:05 UTC 2021
    - 3.9K bytes
    - Viewed (0)
  8. tensorflow/compiler/mlir/tfr/integration/graph_decompose_test.py

    
    class GraphDecomposeTest(test.TestCase):
    
      def testAddN(self):
        add = def_function.function(gen_composite_ops.my_add_n)
        t1 = constant_op.constant([[1.0, 2.0], [3.0, 4.0]])
        t2 = constant_op.constant([[1.0, 2.0], [3.0, 4.0]])
        t3 = constant_op.constant([[1.0, 2.0], [3.0, 4.0]])
        sq1 = add([t1])
        sq2 = add([t1, t2])
        sq3 = add([t1, t2, t3])
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Tue Sep 28 21:37:05 UTC 2021
    - 3.2K bytes
    - Viewed (0)
  9. tensorflow/compiler/mlir/quantization/stablehlo/ops/stablehlo_op_quant_spec_test.cc

      ASSERT_TRUE(module_op);
    
      auto test_func = module_op->lookupSymbol<func::FuncOp>("constant_add");
      ASSERT_THAT(test_func, NotNull());
    
      auto constant_op =
          FindOperationOfType<mlir::stablehlo::ConstantOp>(test_func);
      EXPECT_TRUE(IsOpQuantizableStableHlo(constant_op));
    }
    
    TEST_F(IsOpQuantizableStableHloTest, TerminatorOpNotQuantizable) {
      OwningOpRef<ModuleOp> module_op = ParseModuleOpString(kModuleConstantAdd);
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 04 07:19:09 UTC 2024
    - 14.8K bytes
    - Viewed (0)
  10. tensorflow/cc/experimental/libtf/tests/generate_testdata.py

          tensor_spec.TensorSpec(shape=(), dtype=dtypes.float32),
      ])
      def test_float(self, x):
        return constant_op.constant(3.0) * x
    
      @def_function.function(input_signature=[
          tensor_spec.TensorSpec(shape=(), dtype=dtypes.int32),
      ])
      def test_int(self, x):
        return constant_op.constant(3) * x
    
      @def_function.function(input_signature=[
          tensor_spec.TensorSpec(shape=(), dtype=dtypes.float32),
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Jul 15 16:58:38 UTC 2021
    - 3.3K bytes
    - Viewed (0)
Back to top