Search Options

Results per page
Sort
Preferred Languages
Advance

Results 51 - 60 of 68 for DenseIntElementsAttr (0.75 sec)

  1. tensorflow/compiler/mlir/lite/stablehlo/transforms/fold_broadcast_pass.cc

              class ElementValueT = typename AttrElementT::ValueType>
    Attribute ConstFoldBroadcastInDim(ShapedType result_type,
                                      DenseElementsAttr operand,
                                      DenseIntElementsAttr bcast_dims) {
      auto dimensions = llvm::to_vector(bcast_dims.getValues<int64_t>());
      const auto result_shape = result_type.getShape();
      // Index for the broadcasted matrix.
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 10.5K bytes
    - Viewed (0)
  2. tensorflow/compiler/mlir/lite/flatbuffer_operator.h

    }
    
    template <typename T>
    static inline std::vector<T> GetVector(
        vhlo::TensorV1Attr elements,
        mlir::vhlo::VhloTypeConverter &vhlo_type_converter) {
      return GetOptionalVector<T>(mlir::DenseIntElementsAttr::getFromRawBuffer(
          mlir::cast<mlir::ShapedType>(
              vhlo_type_converter.convertType(elements.getType())),
          elements.getData()));
    }
    
    }  // namespace mlir
    
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu May 16 21:00:09 UTC 2024
    - 11.2K bytes
    - Viewed (0)
  3. tensorflow/compiler/mlir/tensorflow/transforms/decompose_reduce_dataset.cc

    WhileRegionOp CreateDatasetWhile(OpBuilder builder,
                                     ReduceDatasetOp reduce_dataset) {
      auto const_true = builder.create<TF::ConstOp>(
          reduce_dataset.getLoc(),
          DenseIntElementsAttr::get(
              RankedTensorType::get(/*shape=*/{}, builder.getI1Type()), true));
    
      SmallVector<Value, 4> while_input_values;
      SmallVector<Type, 4> while_input_types;
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 14K bytes
    - Viewed (0)
  4. tensorflow/compiler/mlir/lite/transforms/optimize_patterns.td

      "std::distance($0.use_begin(), $0.use_end()) == 2">>;
    def AxesIsLastDimension : Constraint<CPred<
      "$0.cast<DenseIntElementsAttr>().getNumElements() == 1 && "
      "($0.cast<DenseIntElementsAttr>().getValues<APInt>()[0] == "
      "$1.getType().cast<ShapedType>().getRank() - 1 || $0.cast<DenseIntElementsAttr>().getValues<int32_t>()[0] == -1)">>;
    
    // Convert exp(x)/sum(exp(x)) into softmax.
    def OptimizeToSoftmax : Pat<
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu May 16 20:31:41 UTC 2024
    - 66.4K bytes
    - Viewed (0)
  5. tensorflow/compiler/mlir/tensorflow/transforms/convert_control_to_data_outputs.cc

    }
    
    // Generate a dummy constant island of requested type.
    IslandOp GetDummyConstant(OpBuilder builder, ShapedType const_type,
                              Location loc) {
      DenseIntElementsAttr val = DenseIntElementsAttr::get(const_type, 1);
      auto const_op = builder.create<TF::ConstOp>(loc, val);
      auto const_island = CreateIsland(const_op, {}, builder);
      return const_island;
    }
    
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 28.7K bytes
    - Viewed (0)
  6. tensorflow/compiler/mlir/lite/transforms/push_transpose_through_ewise.cc

        Operation *tposed_const;
        if (other_input_type.getNumElements() == 1) {
          tposed_const = cst_arg;
        } else {
          auto inverse_perm_attr = DenseIntElementsAttr::get(
              RankedTensorType::get(inverse_perm.size(), rewriter.getI32Type()),
              inverse_perm);
          auto inverse_perm_op =
              rewriter.create<arith::ConstantOp>(perm.getLoc(), inverse_perm_attr);
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 12.5K bytes
    - Viewed (0)
  7. tensorflow/compiler/mlir/tensorflow/transforms/shape_inference.cc

        return false;
    
      DenseIntElementsAttr slice_sizes_attr;
      if (DenseIntElementsAttr attr;
          matchPattern(op.getSliceSizes(), m_Constant(&attr))) {
        slice_sizes_attr = attr;
      } else if (const auto it = results_.find(ValuePort(op.getSliceSizes()));
                 it != results_.end() &&
                 llvm::isa_and_nonnull<DenseIntElementsAttr>(it->second)) {
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Sat Jun 08 07:28:49 UTC 2024
    - 134.1K bytes
    - Viewed (0)
  8. tensorflow/compiler/mlir/lite/transforms/lower_static_tensor_list.cc

              return allow_tensorlist_pass_through_
                         ? rewriter.notifyMatchFailure(op, error_info)
                         : op.emitOpError(error_info);
            }
          }
        }
    
        DenseIntElementsAttr dense_elem_attr;
        if (matchPattern(element_shape, m_Constant(&dense_elem_attr))) {
          // Note: It's technically unsafe to rewrite
          //     TensorListReserve(num_element, element_shape)
          // to
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Tue Jun 11 20:00:43 UTC 2024
    - 70.7K bytes
    - Viewed (0)
  9. tensorflow/compiler/mlir/tensorflow/transforms/collection_ops_util.cc

    namespace mlir {
    namespace TF {
    namespace collection_ops_util {
    
    Value CreateScalarConst(int32_t value, OpBuilder builder, Location loc) {
      auto attr = DenseIntElementsAttr::get(
          tensorflow::GetTypeFromTFTensorShape({}, builder.getI32Type()), value);
      return builder.create<TF::ConstOp>(loc, attr);
    }
    
    Value GetR1Const(ArrayRef<int64_t> r1, OpBuilder builder, Location loc,
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 14.5K bytes
    - Viewed (0)
  10. tensorflow/compiler/mlir/tensorflow/transforms/replicate_to_island.cc

                                      op)))
            return failure();
    
          OpBuilder builder(op);
          auto const_op = builder.create<TF::ConstOp>(
              op->getLoc(), DenseIntElementsAttr::get(
                                RankedTensorType::get({}, builder.getI64Type()),
                                {device_ordinal}));
          op->replaceAllUsesWith(const_op);
          op->erase();
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Mon Jul 24 21:01:40 UTC 2023
    - 16.9K bytes
    - Viewed (0)
Back to top