Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 13 for getSExtValue (0.32 sec)

  1. tensorflow/compiler/mlir/lite/utils/utils.h

      size_t idx = 0;
      for (; idx < perm_values_attr.size() - 2; ++idx) {
        if (perm_values[idx].getSExtValue() != idx) return false;
      }
    
      return (perm_values[idx].getSExtValue() == perm_values_attr.size() - 1) &&
             (perm_values[idx + 1].getSExtValue() == idx);
    }
    
    // Gets the new type after transposing the last 2 dimensions.
    inline Type TransposeLastTwoDims(Type type) {
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Tue Apr 30 00:40:15 UTC 2024
    - 11.6K bytes
    - Viewed (0)
  2. tensorflow/compiler/mlir/lite/flatbuffer_operator.h

      auto elemType = type.getElementType();
      if (elemType.isSignlessInteger(8)) {
        auto vec = llvm::to_vector(llvm::map_range(
            elements.getValues<APInt>(),
            [&](APInt value) -> int8_t { return value.getSExtValue(); }));
        return std::vector<int8_t>(vec.begin(), vec.end());
      }
    
      return std::vector<int8_t>();
    }
    
    template <>
    inline std::vector<int16_t> GetVector(DenseElementsAttr elements) {
    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/lite/transforms/dilated_conv.h

          // scheme for `Conv2D`.
          int64_t addtional_pad =
              pad_attr ? pad_attr.getValues<APInt>()[{i + 1, j}].getSExtValue() : 0;
          if (stb_paddings_attr.getValues<APInt>()[{i, j}].getSExtValue() +
                  addtional_pad !=
              bts_crops_attr.getValues<APInt>()[{i, j}].getSExtValue()) {
            op->setAttr("padding", rewriter.getStringAttr("SAME"));
            break;
          }
        }
      }
    
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 20K bytes
    - Viewed (0)
  4. tensorflow/compiler/mlir/lite/stablehlo/transforms/hlo_matchers.cc

      }
    
      using StridedArrayViewBase::NextTensorIndex;
      using StridedArrayViewBase::size;
    
      int64_t operator[](int64_t i) const {
        return data_.getValues<APInt>()[OffsetForIndex(i)].getSExtValue();
      }
    
     private:
      const DenseIntElementsAttr& data_;
    };
    
    // It matches %iota generated from the following mlir codes:
    //
    // %iota_r1 = "mhlo.iota"(){iota_dimension = 0} :() -> tensor<Lxi32>
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 11.6K bytes
    - Viewed (0)
  5. tensorflow/compiler/mlir/tensorflow/transforms/collection_ops_util.cc

      int64_t first_index = -1;
      for (const auto& ind : const_op.getValue().getValues<APInt>()) {
        if (last_index == -1) {
          last_index = ind.getSExtValue();
          first_index = last_index;
          continue;
        }
        if (last_index + 1 != ind.getSExtValue()) return -1;
        last_index++;
      }
      return first_index;
    }
    
    }  // namespace
    
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 14.5K bytes
    - Viewed (0)
  6. tensorflow/compiler/mlir/tensorflow/transforms/layout_optimization.cc

        permutation.push_back(value.getSExtValue());
    
      // Check if we can fold transpose into the operation.
      if (fold_operands && fold_transpose_in_ops) {
        SmallVector<int64_t, 8> permutation;
    
        auto attr = mlir::cast<DenseElementsAttr>(permutation_op.getValue());
        for (const auto& value : attr.getValues<APInt>())
          permutation.push_back(value.getSExtValue());
    
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 19.3K bytes
    - Viewed (0)
  7. tensorflow/compiler/mlir/quantization/common/ir/UniformSupport.h

        return std::move(result);
      }
    
      int64_t quantizeFloatToInt64(APFloat expressed_value) const {
        const APInt q_value = quantizeFloatToInt(std::move(expressed_value));
        return is_signed_ ? q_value.getSExtValue() : q_value.getZExtValue();
      }
    
      virtual ~UniformQuantizedValueConverter() = default;
    
     private:
      // An optimized implementation to quantize f32 to i8/u8 with C++ native
      // arithmetic.
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Wed May 08 02:10:16 UTC 2024
    - 9.8K bytes
    - Viewed (0)
  8. tensorflow/compiler/mlir/lite/transforms/post_quantize.cc

            return failure();
    
          SmallVector<int64_t, 4> shape_data;
          for (const APInt& it : shape_elements.getValues<APInt>()) {
            shape_data.push_back(it.getSExtValue());
          }
          result_type =
              RankedTensorType::get(shape_data, input_type.getElementType());
        }
        auto values_type = RankedTensorType::get(
            result_type.getShape(),
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 17.1K bytes
    - Viewed (0)
  9. tensorflow/compiler/mlir/lite/transforms/prepare_quantize_helper.h

          return failure();
        }
    
        SmallVector<int64_t, 4> axes;
        for (const auto& axis_int : perm.getValues<APInt>()) {
          int64_t axis = axis_int.getSExtValue();
          if (axis < 0) {
            axis += input_type.getRank();
          }
          if (axis < 0 || (input_type.hasRank() && axis >= input_type.getRank())) {
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Fri May 03 18:01:23 UTC 2024
    - 28K bytes
    - Viewed (0)
  10. tensorflow/compiler/mlir/lite/experimental/tac/transforms/device_transform_patterns.cc

      for (int i = 0; i < pad_dimensions - attr.getNumElements(); ++i) {
        value_i32.push_back(value_to_pad);
      }
      for (const auto& size : attr) {
        value_i32.push_back(static_cast<int32_t>(size.getSExtValue()));
      }
      auto new_value_i32_attr =
          mlir::DenseIntElementsAttr::get(value_shape_type, value_i32);
    
      return builder->create<TF::ConstOp>(loc, new_value_i32_attr);
    }
    
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 25.4K bytes
    - Viewed (0)
Back to top