Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 18 for DenseIntElementsAttr (0.46 sec)

  1. tensorflow/compiler/mlir/lite/stablehlo/transforms/composite_utils.h

    // Get a DenseIntElementsAttr of type I64 and convert it to an I32 attribute.
    DenseIntElementsAttr DenseI64AttrToI32Attr(
        const DenseIntElementsAttr& dense_attr, PatternRewriter& builder);
    
    // Returns a NHWC shaped type from an NCHW shaped type op.
    // For example- Given a Composite op that wraps a core.aten.avg_pool2d, this
    // returns the return type of the tfl.average_pool_2d emitted. Note that the
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Wed May 29 18:33:05 UTC 2024
    - 3.4K bytes
    - Viewed (0)
  2. tensorflow/compiler/mlir/lite/stablehlo/transforms/composite_utils.cc

    #include "mlir/IR/Value.h"  // from @llvm-project
    #include "mlir/Support/LLVM.h"  // from @llvm-project
    
    namespace mlir {
    namespace odml {
    
    DenseIntElementsAttr DenseI64AttrToI32Attr(
        const DenseIntElementsAttr& dense_attr, PatternRewriter& builder) {
      std::vector<int32_t> ret(dense_attr.getNumElements());
      auto range = dense_attr.getValues<int64_t>();
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Wed May 29 18:33:05 UTC 2024
    - 3.4K bytes
    - Viewed (0)
  3. tensorflow/compiler/mlir/lite/stablehlo/transforms/composite_utils.td

    // Receives a composite DictionaryAttr and returns the value of the Attribute
    // with the key `attr_name` as a DenseIntElementsAttr.
    class GetAsVectorAttr<string attr_name>:
      GetCompositeAttributeAs<attr_name, "DenseIntElementsAttr">;
    
    class IsBoolAttrEqual<string true_or_false> : Constraint<CPred<
      "$0.getValue() == "#true_or_false#"">>;
    
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Wed May 08 19:05:30 UTC 2024
    - 2.7K bytes
    - Viewed (0)
  4. tensorflow/compiler/mlir/tensorflow/ir/tf_ops_layout_helper.cc

          new_shape[i] = shape[permutation[i]];
    
        return RankedTensorType::get(new_shape, ranked_type.getElementType());
      }
    
      return type;
    }
    
    bool AreCancellablePermutations(DenseIntElementsAttr perm0,
                                    DenseIntElementsAttr perm1) {
      if (perm0.getNumElements() == 0 || perm1.getNumElements() == 0) return false;
      if (perm0.getNumElements() != perm1.getNumElements()) return false;
    
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 3.3K bytes
    - Viewed (0)
  5. tensorflow/compiler/mlir/lite/stablehlo/transforms/hlo_matchers.h

    // 2. IotaOp + BroadCastInDim.
    // 3. IotaOp + Reshape.
    // 4. Constant (folded Iota) + BroadCastInDim.
    // 5. Constant (folded result).
    // Moreover, the dimensions has to match the iota_dimension.
    bool MatchIota(DenseIntElementsAttr dimensions, Value iota);
    }  // namespace odml
    }  // namespace mlir
    
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Tue Mar 05 20:53:17 UTC 2024
    - 1.4K bytes
    - Viewed (0)
  6. tensorflow/compiler/mlir/lite/stablehlo/transforms/composite_avg_pool.h

    namespace odml {
    
    // Given a Composite op that wraps a core.aten.avg_pool2d, returns the padding
    // configuration required for the `tfl.pad` if the padding part of the op is
    // to be done before average pooling.
    DenseIntElementsAttr GetPadOpAttr(Builder& builder, mhlo::CompositeOp op);
    
    // Given a Composite op that wraps a core.aten.avg_pool2d, and assuming that
    // the padding part is extracted into a tfl.pad op prior to a
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Tue May 28 23:16:05 UTC 2024
    - 2.5K bytes
    - Viewed (0)
  7. tensorflow/compiler/mlir/lite/stablehlo/transforms/fuse_convolution_pass.cc

        Operation *bcast_or_const_op;
        shape::ShapeOfOp shape_of_op;
        mhlo::ConstantOp filter;
        mhlo::ConstantOp multiplier;
        mlir::ElementsAttr filter_value, mul_value;
        mlir::DenseIntElementsAttr broadcast_dims;
    
        // Match and capture values/attributes.
        Value lhs = mul_op.getLhs();
        Value rhs = mul_op.getRhs();
        conv_op = lhs.getDefiningOp<mhlo::ConvolutionOp>();
        if (conv_op == nullptr) {
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Feb 22 22:21:19 UTC 2024
    - 8.3K bytes
    - Viewed (0)
  8. tensorflow/compiler/mlir/lite/stablehlo/transforms/optimize_layout.cc

        DenseI64ArrayAttr new_win_dilations =
            getInvertPermutedAttr(reduce_op.getWindowDilations());
    
        auto padding = reduce_op.getPadding();
        int64_t rank = transpose_perm.size();
        DenseIntElementsAttr new_padding_attr = nullptr;
        if (padding.has_value()) {
          SmallVector<int64_t> new_padding(rank * 2, 0);
          auto old_padding = (*padding).getValues<int64_t>();
          for (int64_t idx = 0; idx < rank; ++idx) {
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 21:59:06 UTC 2024
    - 8.6K bytes
    - Viewed (0)
  9. tensorflow/compiler/mlir/lite/transforms/optimize_batch_matmul.cc

        if (bmm_op.getAdjX()) {
          rY = rhs_shape.size() - 2;
          cY = rhs_shape.size() - 1;
        }
    
        auto reduce_dim_op = rewriter.create<TFL::ConstOp>(
            bmm_op->getLoc(),
            DenseIntElementsAttr::get(
                RankedTensorType::get({1}, rewriter.getI32Type()), {cY}));
        auto sum_op = rewriter.create<TFL::SumOp>(
            bmm_op->getLoc(), bmm_op.getType(), bmm_op.getY(), reduce_dim_op,
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 9.6K bytes
    - Viewed (0)
  10. tensorflow/compiler/mlir/tensorflow/transforms/rewrite_util.h

            float_attr.getSplatValue<APFloat>().isExactlyValue(raw_value))
          return true;
      } else if (mlir::isa<IntegerType>(element_type)) {
        DenseIntElementsAttr int_attr;
        if (matchPattern(value, m_Constant(&int_attr)) && int_attr.isSplat() &&
            int_attr.getSplatValue<APInt>() == raw_value)
          return true;
      }
    
      return false;
    }
    
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Wed May 22 19:47:48 UTC 2024
    - 4K bytes
    - Viewed (0)
Back to top