Search Options

Results per page
Sort
Preferred Languages
Advance

Results 51 - 60 of 64 for ConstantOp (0.37 sec)

  1. 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)
  2. tensorflow/compiler/mlir/lite/stablehlo/transforms/legalize_hlo.cc

          {pad_op.getEdgePaddingLow().size()}, rewriter.getI64Type());
      auto slice_begins_const_op = rewriter.create<arith::ConstantOp>(
          loc, slice_attr_type,
          DenseIntElementsAttr::get(slice_attr_type, slice_begins));
      auto slice_sizes_const_op = rewriter.create<arith::ConstantOp>(
          loc, slice_attr_type,
          DenseIntElementsAttr::get(slice_attr_type, slice_sizes));
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 154.9K bytes
    - Viewed (0)
  3. 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)
  4. tensorflow/compiler/mlir/lite/utils/lstm_utils_test.cc

      // output gate bias is 0 since it is out of bounds of the bias tensor, so
      // we set its value as a const tensor of specified size and value 0.
      EXPECT_TRUE(
          mlir::cast<ElementsAttr>(mlir::cast<mlir::arith::ConstantOp>(
                                       it->getOpOperand(15).get().getDefiningOp())
                                       .getValue())
              .getValues<FloatAttr>()[0]
              .getValue()
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 10K bytes
    - Viewed (0)
  5. tensorflow/compiler/mlir/lite/transforms/prepare_quantize_helper.h

          Value input = op.getOperand(index);
    
          if (input.getDefiningOp() == nullptr) continue;
    
          // TODO(b/172517537): make this work with non-PTQ case.
          if (llvm::isa<func::ConstantOp, arith::ConstantOp, TFL::ConstOp>(
                  input.getDefiningOp())) {
            // Tensors with derived scale are biases, and handled in propagation.
            if (tensor_property.use_derived_scale) continue;
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Fri May 03 18:01:23 UTC 2024
    - 28K bytes
    - Viewed (0)
  6. tensorflow/compiler/mlir/lite/stablehlo/transforms/unfuse_batch_norm_pass.cc

      }
    
      auto scalar_type = RankedTensorType::get(/*shape=*/{}, fp_type);
      auto epsilon_tensor_attr = DenseElementsAttr::get(
          scalar_type, {mlir::cast<Attribute>(epsilon_attr)});
      Value epsilon = b.create<mhlo::ConstantOp>(epsilon_tensor_attr);
      auto dims_type = RankedTensorType::get(/*shape=*/{0}, b.getIntegerType(64));
      auto dims = DenseIntElementsAttr::get(dims_type, SmallVector<int64_t, 1>{});
      if (broadcast_to_type.hasStaticShape()) {
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 11.2K bytes
    - Viewed (0)
  7. tensorflow/compiler/mlir/quantization/tensorflow/passes/preprocess_op.cc

        auto new_shape_const_attr =
            DenseElementsAttr::get(shape_spec_type, new_shape.getShape());
        rewriter.setInsertionPointAfter(weight_op);
        auto new_shape_const = rewriter.create<arith::ConstantOp>(
            weight_op->getLoc(), shape_spec_type, new_shape_const_attr);
        auto reshape_op = rewriter.create<TF::ReshapeOp>(
            weight_op->getLoc(), new_shape, weight_op->getResult(0),
            new_shape_const);
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 11.4K bytes
    - Viewed (0)
  8. 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)
  9. tensorflow/compiler/mlir/quantization/common/quantization_lib/quantization_utils.cc

          scales, zero_points, quant_dim, qtype.getStorageTypeMin(),
          qtype.getStorageTypeMax());
    }
    
    }  // namespace
    
    bool IsOpQuantizable(Operation* op) {
      if (isa<func::ConstantOp, arith::ConstantOp, quantfork::StatisticsOp>(op)) {
        // Constant ops do not have QuantizableResult attribute but they can deal
        // with quantized tensors.
        return true;
      } else if (op->hasTrait<OpTrait::IsTerminator>() ||
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Wed May 08 02:10:16 UTC 2024
    - 43.2K bytes
    - Viewed (0)
  10. tensorflow/compiler/mlir/lite/flatbuffer_export.cc

    }
    
    static bool IsConst(Operation* op) {
      return isa<mlir::func::ConstantOp, mlir::arith::ConstantOp, mlir::TF::ConstOp,
                 tfl::ConstOp, tfl::QConstOp, tfl::SparseConstOp,
                 tfl::SparseQConstOp, mlir::TFL::NoValueOp,
                 mlir::stablehlo::ConstantOp, mlir::vhlo::ConstantOpV1>(op);
    }
    
    static bool IsTFResourceOp(Operation* op) {
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Wed Jun 12 21:41:49 UTC 2024
    - 164.5K bytes
    - Viewed (0)
Back to top