Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 28 for DenseIntElementsAttr (0.21 sec)

  1. tensorflow/compiler/mlir/lite/transforms/legalize_patterns.td

    class I32VectorElementsAttr<int len> : ElementsAttrBase<
      CPred<"$_self.isa<DenseIntElementsAttr>() &&"
          "$_self.cast<DenseIntElementsAttr>().getType()."
          "getElementType().isSignlessInteger(32)">,
      "32-bit int elements attribute of shape [" # len # "]"> {
    
      let storageType = [{ DenseIntElementsAttr }];
      let returnType = [{ DenseIntElementsAttr }];
    
      let constBuilderCall = "DenseElementsAttr::get("
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Tue Jun 04 13:30:42 UTC 2024
    - 28.5K bytes
    - Viewed (0)
  2. tensorflow/compiler/mlir/quantization/common/attrs_and_constraints.h

                           const SmallVector<T>& values) {
      if constexpr (std::is_integral_v<T>) {
        auto shape_type =
            RankedTensorType::get(shape, builder.getIntegerType(sizeof(T) * 8));
    
        const auto attr = DenseIntElementsAttr::get(shape_type, values);
        return builder.create<TF::ConstOp>(loc, attr);
      }
    
      const auto type = RankedTensorType::get(shape, builder.getF32Type());
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 9.9K bytes
    - Viewed (0)
  3. tensorflow/compiler/mlir/lite/flatbuffer_operator.cc

        extendVec[i] = llvm::APInt(1, value[i]);
      }
      mlir::RankedTensorType ty =
          tensorflow::GetTypeFromTFTensorShape(shape, builder.getIntegerType(1));
      return mlir::DenseIntElementsAttr::get(ty, extendVec);
    }
    
    static mlir::Attribute BuildRankedTensorAttr(std::vector<int64_t> shape,
                                                 std::vector<int64_t> value,
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Tue May 21 18:21:50 UTC 2024
    - 38K bytes
    - Viewed (0)
  4. tensorflow/compiler/mlir/quantization/stablehlo/passes/bridge/convert_tf_quant_ops_to_mhlo.cc

      }
      return dnums;
    }
    
    DenseIntElementsAttr ConvertToDenseElementsAttr(ArrayAttr array_attr,
                                                    PatternRewriter &rewriter) {
      SmallVector<int64_t> array;
      array.reserve(array_attr.size());
      for (auto elem : array_attr.getAsRange<IntegerAttr>()) {
        array.push_back(elem.getInt());
      }
      return DenseIntElementsAttr::get(
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Fri May 17 17:58:54 UTC 2024
    - 30.9K bytes
    - Viewed (0)
  5. tensorflow/compiler/mlir/tf2xla/transforms/legalize_tf_patterns.td

    def CanBeTranslatedToDynamicSlice : Constraint<CPred<
      "CanBeTranslatedToDynamicSlice($0, $1, $2.cast<DenseIntElementsAttr>())">>;
    
    def TFSliceSizes2HLOSliceSizes : NativeCodeCall<
        "TFSliceSizes2HLOSliceSizes($0, $1, $2.cast<DenseIntElementsAttr>(),"
        "&$_builder)">;
    
    def : Pat<(TF_SliceOp:$op MHLO_Tensor:$input, MHLO_Tensor:$starting_indices,
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Mon May 06 18:46:23 UTC 2024
    - 34.8K bytes
    - Viewed (0)
  6. tensorflow/compiler/mlir/lite/stablehlo/transforms/tfl_stablehlo_pass.cc

                value = builder->getDenseI64ArrayAttr(vec);
              } else {
                RankedTensorType ty = tensorflow::GetTypeFromTFTensorShape(
                    shape, builder->getIntegerType(64));
                value = DenseIntElementsAttr::get(ty, vec);
              }
              auto named_attr = builder->getNamedAttr(key, value);
              attrs.push_back(named_attr);
              break;
            }
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Wed Jan 24 06:08:43 UTC 2024
    - 10.8K bytes
    - Viewed (0)
  7. tensorflow/compiler/mlir/tensorflow/transforms/layout_optimization.cc

        Location loc = op->getLoc();
        OpBuilder builder = OpBuilder::atBlockEnd(op->getBlock());
    
        auto perm_attr = [&](Permutation permutation) -> DenseIntElementsAttr {
          auto perm_ty = RankedTensorType::get({4}, builder.getIntegerType(64));
          return DenseIntElementsAttr::get(perm_ty, permutation);
        };
    
        // Change operation data format.
        if (failed(layout_sensitive_interface.UpdateDataFormat(target_data_format)))
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 19.3K bytes
    - Viewed (0)
  8. tensorflow/compiler/mlir/quantization/stablehlo/passes/defer_activation_transpose.cc

                /*window_dilations=*/
                PermuteI64ArrayAttr(rewriter, op.getWindowDilations(),
                                    kNchwToNhwcPermutation),
                /*padding=*/DenseIntElementsAttr(nullptr));
    
        // Clone the reduce body. It is not affected by the permutation.
        IRMapping mapping;
        op.getBody().cloneInto(&new_reduce_window_op.getBody(), mapping);
    
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 11.5K bytes
    - Viewed (0)
  9. 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)
  10. 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)
Back to top