Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 34 for num_elements (0.39 sec)

  1. tensorflow/compiler/mlir/lite/transforms/lower_static_tensor_list.cc

        Type shape_dtype = getElementTypeOrSelf(op.getElementShape().getType());
        Value num_elements = operands[1];
        IntegerAttr attr;
        if (matchPattern(num_elements, m_Constant(&attr))) {
          return CreateI32SplatConst(op.getLoc(), rewriter, {1}, attr.getInt());
        }
        if (auto const_op = num_elements.getDefiningOp<TF::ConstOp>()) {
          return CreateI32SplatConst(op->getLoc(), rewriter, {1},
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Tue Jun 11 20:00:43 UTC 2024
    - 70.7K bytes
    - Viewed (0)
  2. tensorflow/compiler/mlir/tfrt/tests/mlrt/while_to_map_fn.mlir

      // CHECK-NEXT: TensorListStack
      %2 = "tf.TensorListStack"(%1#2, %cst_0) {device = "/job:localhost/replica:0/task:0/device:CPU:0", num_elements = 2 : i64} : (tensor<!tf_type.variant<tensor<*xf32>>>, tensor<1xi32>) -> tensor<2x8xf32>
      %3 = "tf.TensorListStack"(%1#3, %cst_0) {device = "/job:localhost/replica:0/task:0/device:CPU:0", num_elements = 2 : i64} : (tensor<!tf_type.variant<tensor<*xf32>>>, tensor<1xi32>) -> tensor<2x8xf32>
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Tue Apr 23 06:40:22 UTC 2024
    - 68.6K bytes
    - Viewed (0)
  3. tensorflow/compiler/mlir/tensorflow/ir/tf_ops_n_z.cc

      SmallVector<ValueType, 16> new_values;
      new_values.reserve(num_elements);
      ValueType new_value = start;
      for (int i = 0; i < num_elements; ++i) {
        new_values.push_back(new_value);
        new_value = new_value + delta;
      }
      // Result is always a 1-D tensor.
      auto new_result_type =
          tensorflow::GetTypeFromTFTensorShape({num_elements}, result_elem_type);
      return DenseElementsAttr::get(new_result_type, new_values);
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu May 09 22:07:10 UTC 2024
    - 170.8K bytes
    - Viewed (0)
  4. tensorflow/c/eager/c_api.cc

      if (h == nullptr) {
        status->status = tensorflow::errors::InvalidArgument("Invalid handle");
        return -1;
      }
    
      int64_t num_elements = -1;
      status->status = tensorflow::unwrap(h)->NumElements(&num_elements);
      return num_elements;
    }
    
    int64_t TFE_TensorHandleDim(TFE_TensorHandle* h, int dim_index,
                                TF_Status* status) {
      if (h == nullptr) {
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu May 09 08:11:23 UTC 2024
    - 44K bytes
    - Viewed (0)
  5. tensorflow/compiler/jit/xla_tpu_device.cc

        if (src->name() != dst->name()) {
          Status s = CheckIfTPUInitialized();
          if (!s.ok()) {
            done(s);
            return absl::OkStatus();
          }
        }
        if (input->shape().num_elements() == 0) {
          // Zero-element tensors have no backing buffers.
          done(absl::OkStatus());
          return absl::OkStatus();
        }
    
        se::Stream* const src_compute_stream = src_xla_context->stream();
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Tue May 28 22:53:47 UTC 2024
    - 20.9K bytes
    - Viewed (0)
  6. tensorflow/compiler/mlir/tensorflow/utils/convert_tensor.cc

      // We can create an MLIR Attribute more efficiently in this case.
      TensorShape input_tensor_shape(input_tensor.tensor_shape());
      if (NumberOfMaterializedElements(input_tensor) == 1 &&
          input_tensor_shape.num_elements() > 1) {
        // We first convert this TensorProto to one of shape [1]. We then create an
        // Attribute for that proto, and finally splat the Attribute.
    
        TensorProto tensor_copy = input_tensor;
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Fri Apr 26 09:37:10 UTC 2024
    - 20.5K bytes
    - Viewed (0)
  7. tensorflow/compiler/mlir/lite/transforms/optimize.cc

    TypedAttr GetNumElementsOrOne(Type type) {
      auto shaped_type = mlir::cast<ShapedType>(type);
      int32_t num_elements =
          shaped_type.hasStaticShape() ? shaped_type.getNumElements() : 1;
    
      OpBuilder builder(type.getContext());
    
      return DenseIntElementsAttr::get(
          RankedTensorType::get({}, builder.getI32Type()),
          {llvm::APInt(32, num_elements, true)});
    }
    
    // Reshapes value to a given shape.
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Tue Apr 30 00:40:15 UTC 2024
    - 102.3K bytes
    - Viewed (0)
  8. tensorflow/compiler/mlir/tf2xla/transforms/legalize_tf.cc

                                        builder->getBoolAttr(false));
    }
    
    // Creates a mhlo.rng_uniform op with `builder` to generate `num_elements`
    // 32-bit integer numbers in the range of [`lower_limit`, `upper_limit`).
    static mhlo::RngOp CreateRngUniform32(Location loc, int num_elements,
                                          int lower_limit, int upper_limit,
                                          OpBuilder *builder) {
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Tue Jun 11 20:00:43 UTC 2024
    - 291.8K bytes
    - Viewed (0)
  9. tensorflow/c/c_api_test.cc

      const int num_dims = 2;
      int64_t* dims = new int64_t[num_dims];
      int64_t num_elements = 1;
      dims[0] = batch_size;
      dims[1] = 1;
      for (int64_t i = 0; i < num_dims; ++i) {
        num_elements *= dims[i];
      }
      TF_Tensor* t = TF_AllocateTensor(TF_STRING, dims, num_dims,
                                       sizeof(TF_TString) * num_elements);
      delete[] dims;
    
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Mon Apr 15 03:35:10 UTC 2024
    - 96.9K bytes
    - Viewed (0)
  10. tensorflow/compiler/jit/xla_launch_util.cc

    // Construct the tensor for the given type and buffer.
    static Tensor MakeTensor(DataType dtype, const TensorShape& shape,
                             se::DeviceMemoryBase buffer, Allocator* allocator) {
      size_t expected_size = shape.num_elements() * DataTypeSize(dtype);
      auto* tensor_buffer = new XlaTensorBuffer(buffer.opaque(), expected_size,
                                                buffer.size(), allocator);
      Tensor t(dtype, shape, tensor_buffer);
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu May 16 00:36:08 UTC 2024
    - 40.4K bytes
    - Viewed (0)
Back to top