Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 100 for num_elements (0.19 sec)

  1. tensorflow/compiler/mlir/lite/utils/low_bit_utils.cc

    #include <vector>
    
    namespace tflite {
    
    std::vector<uint8_t> PackInt4ValuesDensely(std::vector<uint8_t> src_buffer) {
      auto num_elements = src_buffer.size();
      auto packed_size = (num_elements + 1) / 2;
      std::vector<uint8_t> packed_buffer((num_elements + 1) / 2);
    
      for (int i = 0; i < num_elements - 1; i += 2) {
        packed_buffer[i / 2] = src_buffer[i] & 0x0F;
        packed_buffer[i / 2] |= src_buffer[i + 1] << 4;
      }
    
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu May 04 19:11:58 UTC 2023
    - 2K bytes
    - Viewed (0)
  2. tensorflow/c/experimental/saved_model/core/test_utils.cc

    void CheckBufferDataIsEqual(DataType dtype, int64_t num_elements, void* a,
                                void* b) {
      switch (dtype) {
    #define CASE(type)                                       \
      case DataTypeToEnum<type>::value: {                    \
        type* typed_a = static_cast<type*>(a);               \
        type* typed_b = static_cast<type*>(b);               \
        for (int64_t i = 0; i < num_elements; ++i) {         \
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Fri Sep 08 20:13:32 UTC 2023
    - 5.8K bytes
    - Viewed (0)
  3. tensorflow/c/eager/dlpack_test.cc

                              std::vector<int64_t> shape,
                              std::vector<int64_t> strides) {
      size_t num_elements = 1;
      for (int i = 0; i < static_cast<int32_t>(shape.size()); ++i) {
        num_elements *= shape[i];
      }
      std::vector<float> data(num_elements);
      for (size_t j = 0; j < num_elements; ++j) {
        data[j] = j;
      }
      DLManagedTensor dlm_in = {};
      DLTensor* dltensor_in = &dlm_in.dl_tensor;
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Fri Jun 30 03:04:46 UTC 2023
    - 4.4K bytes
    - Viewed (0)
  4. tensorflow/cc/experimental/libtf/runtime/runtime.h

      size_t num_elements = 1;
      for (int dim = 0; dim < shape.size(); dim++) {
        if (shape[dim] < 0) {
          return tensorflow::errors::InvalidArgument(absl::StrCat(
              "Shape must be fully-defined, got: shape[", dim, "] = ", shape[dim]));
        }
        num_elements *= shape[dim];
      }
      if (data.size() != num_elements) {
        return tensorflow::errors::InvalidArgument(absl::StrCat(
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Sep 01 11:18:25 UTC 2022
    - 4.4K bytes
    - Viewed (0)
  5. tensorflow/compiler/mlir/tensorflow/tests/graphdef2mlir/tensor-list.pbtxt

    # RUN: tf-mlir-translate -graphdef-to-mlir %s -o - | FileCheck %s
    
    node {
      name: "TensorListReserve/num_elements"
      op: "Const"
      attr {
        key: "dtype"
        value {
          type: DT_INT32
        }
      }
      attr {
        key: "value"
        value {
          tensor {
            dtype: DT_INT32
            tensor_shape {
            }
            int_val: 3
          }
        }
      }
      experimental_debug_info {
      }
    }
    node {
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Jul 29 04:41:05 UTC 2021
    - 3.6K bytes
    - Viewed (0)
  6. tensorflow/compiler/mlir/lite/transforms/optimize_op_order.cc

        auto get_num_elements = [](RankedTensorType tensor) {
          int num_elements = 1;
          for (int i = 0; i < tensor.getRank(); ++i) {
            // Assume dynamic dim size as the dim size one.
            if (!tensor.isDynamicDim(i)) {
              num_elements *= tensor.getDimSize(i);
            }
          }
          return num_elements;
        };
    
        // If the op is the pass-through op with (3x) smaller output, the dequantize
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 5.1K bytes
    - Viewed (0)
  7. tensorflow/compiler/jit/tests/device_compiler_test_helper.cc

        TF_RETURN_IF_ERROR(session->Create(graph));
        RunOptions run_options;
    
        Tensor input_a = CreateInputTensor(shape, 0);
        Tensor input_b = CreateInputTensor(shape, shape.num_elements());
        Tensor input_c = CreateInputTensor(shape, 2 * shape.num_elements());
        TF_RETURN_IF_ERROR(session->Run(
            run_options,
            {std::make_pair("a", input_a), std::make_pair("b", input_b),
             std::make_pair("c", input_c)},
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Fri Feb 09 08:24:16 UTC 2024
    - 6.2K bytes
    - Viewed (0)
  8. tensorflow/cc/experimental/base/tests/tensor_test.cc

      EXPECT_EQ(tensor.dtype(), dtype);
      EXPECT_EQ(*reinterpret_cast<typename TypeParam::type*>(tensor.data()), 42);
      EXPECT_EQ(tensor.num_bytes(), sizeof(typename TypeParam::type));
      EXPECT_EQ(tensor.num_elements(), 1);
    }
    
    template <typename T>
    class Construct1DTensorTest : public ::testing::Test {};
    TYPED_TEST_SUITE(Construct1DTensorTest, SimpleTypes);
    
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Sat Apr 13 09:56:08 UTC 2024
    - 6K bytes
    - Viewed (0)
  9. tensorflow/compiler/mlir/quantization/tensorflow/passes/prepare_lifting.cc

        return {};
      }
    
      int64_t num_elements = value_shape.getNumElements();
      SmallVector<int64_t> new_shape;
      for (auto idx : llvm::reverse(llvm::seq<int32_t>(0, rhs_shape.getRank()))) {
        const int64_t rhs_dim = rhs_shape.getDimSize(idx);
        if (num_elements % rhs_dim != 0) {
          return {};
        }
        new_shape.push_back(rhs_dim);
        num_elements = num_elements / rhs_dim;
        if (num_elements == 1) break;
      }
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Fri May 17 17:58:54 UTC 2024
    - 13.3K bytes
    - Viewed (0)
  10. tensorflow/compiler/mlir/tensorflow/tests/compile_mlir_util/replicate-tensor-list-init-ops.mlir

        %elem_shape_2 = "tf.Const"() {value = dense<-1> : tensor<1xi32>} : () -> tensor<1xi32>
        %tls = "tf.TensorListStack"(%tl_set_item, %elem_shape_2) {num_elements = 300 : i64} : (tensor<!tf_type.variant<tensor<*xf32>>>, tensor<1xi32>) -> tensor<300x?xf32>
    
        %elem_2 = "tf.Const"() {value = dense<10.0> : tensor<9xf32>} : () -> tensor<9xf32>
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Fri Feb 03 09:30:08 UTC 2023
    - 1.9K bytes
    - Viewed (0)
Back to top