Search Options

Results per page
Sort
Preferred Languages
Advance

Results 31 - 40 of 69 for ConstantOp (0.15 sec)

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

        Value key_constant_tensor = rewriter.create<arith::ConstantOp>(
            op.getLoc(),
            DenseStringElementsAttr::get(
                RankedTensorType::get(static_cast<int64_t>(lines.size()),
                                      StringType::get(rewriter.getContext())),
                lines));
    
        Value value_constant_tensor = rewriter.create<arith::ConstantOp>(
            op.getLoc(), rewriter.getI64TensorAttr(line_nums));
    
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Nov 03 12:35:38 UTC 2022
    - 6.1K bytes
    - Viewed (0)
  2. tensorflow/compiler/mlir/quantization/stablehlo/ops/stablehlo_op_quant_spec.cc

        scale_spec->has_same_operand_and_result_type_requirement = true;
      }
      return scale_spec;
    }
    
    bool IsOpQuantizableStableHlo(Operation* op) {
      if (isa<func::ConstantOp, mlir::stablehlo::ConstantOp>(op)) {
        // Constant ops do not have QuantizableResult attribute but can be
        // quantized.
        return true;
      } else if (op->hasTrait<OpTrait::IsTerminator>() ||
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu May 09 05:56:10 UTC 2024
    - 7.8K bytes
    - Viewed (0)
  3. tensorflow/compiler/mlir/quantization/stablehlo/passes/convert_func_to_bfloat16.cc

          if (failed(rewriter.convertRegionTypes(&new_region, *getTypeConverter())))
            return failure();
        }
    
        // Convert value of ConstantOp to bfloat16.
        if (auto const_op = dyn_cast<mlir::stablehlo::ConstantOp>(op)) {
          const auto values = const_op.getValue().tryGetValues<float>();
          if (!values.has_value()) {
            return failure();
          }
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 9.3K bytes
    - Viewed (0)
  4. tensorflow/compiler/mlir/quantization/common/attrs_and_constraints_test.cc

    #include "tensorflow/compiler/mlir/tensorflow/ir/tf_ops.h"
    #include "tsl/platform/status_matchers.h"
    
    namespace mlir::quant {
    namespace {
    
    using ::mlir::stablehlo::AddOp;
    using ::mlir::stablehlo::ConstantOp;
    using ::mlir::stablehlo::ConvolutionOp;
    using ::mlir::stablehlo::DotGeneralOp;
    using ::mlir::stablehlo::SubtractOp;
    using ::testing::ElementsAreArray;
    using ::testing::Eq;
    using ::testing::IsEmpty;
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Tue May 14 17:10:32 UTC 2024
    - 22.9K bytes
    - Viewed (0)
  5. tensorflow/compiler/mlir/tensorflow/transforms/einsum.cc

      auto constant_attr = rewriter->getI32TensorAttr(values);
      return rewriter->create<arith::ConstantOp>(loc, values_type, constant_attr);
    }
    
    // Creates ConstantOp for array of int64_t.
    arith::ConstantOp createI64ConstantOp(llvm::ArrayRef<int64_t> values,
                                          Location loc, PatternRewriter* rewriter) {
      auto values_type = RankedTensorType::get(
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 33.3K bytes
    - Viewed (0)
  6. tensorflow/compiler/mlir/tensorflow/transforms/device_index_selector.cc

          if (!isa<TF::CaseOp>(use)) return;
        }
        DenseElementsAttr attr =
            DenseElementsAttr::get(type, b.getI32IntegerAttr(index));
        auto constant = b.create<arith::ConstantOp>(op.getLoc(), type, attr);
        op.replaceAllUsesWith(constant.getOperation());
        op.erase();
      });
    }
    
    // Creates an instance of the TensorFlow DeviceIndex selector pass.
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Nov 03 12:35:38 UTC 2022
    - 3.4K bytes
    - Viewed (0)
  7. tensorflow/compiler/mlir/lite/transforms/optimize.cc

            added_value.reshape(RankedTensorType::get(
                {num_dims},
                mlir::cast<ShapedType>(added_value.getType()).getElementType()));
        ::mlir::arith::ConstantOp new_end = rewriter.create<arith::ConstantOp>(
            strided_slice_op.getEnd().getLoc(), new_added_value);
    
        if (strided_slice_op.getBeginMask() != 0) return failure();
        if (strided_slice_op.getEndMask() != 0) return failure();
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Tue Apr 30 00:40:15 UTC 2024
    - 102.3K bytes
    - Viewed (0)
  8. tensorflow/compiler/mlir/lite/quantization/ir/ConvertConst.cc

      // original const and the qbarrier that led to the quantization.
      auto fusedLoc = rewriter.getFusedLoc(
          {qbarrier.getArg().getDefiningOp()->getLoc(), qbarrier.getLoc()});
      auto newConstOp = rewriter.create<arith::ConstantOp>(
          fusedLoc, newConstValueType, cast<TypedAttr>(newConstValue));
      rewriter.replaceOpWithNewOp<StorageCastOp>(qbarrier, qbarrier.getType(),
                                                 newConstOp);
      return success();
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 4.4K bytes
    - Viewed (0)
  9. 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)
  10. 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)
Back to top