Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 91 for Shape (0.16 sec)

  1. tensorflow/c/eager/dlpack_test.cc

      dltensor_in->device = {kDLCPU, 0};
      dltensor_in->ndim = static_cast<int32_t>(shape.size());
      dltensor_in->dtype = {kDLFloat, 32, 1};
      dltensor_in->shape = shape.data();
      dltensor_in->strides = strides.data();
      TFE_TensorHandle* handle = TFE_HandleFromDLPack(&dlm_in, status, ctx);
      ASSERT_NE(handle, nullptr)
          << TF_Message(status) << " (shape=[" << absl::StrJoin(shape, ",")
          << "], strides=[" << absl::StrJoin(strides, ",") << "])";
    
    C++
    - Registered: Tue Apr 23 12:39:09 GMT 2024
    - Last Modified: Fri Jun 30 03:04:46 GMT 2023
    - 4.4K bytes
    - Viewed (0)
  2. tensorflow/c/c_api.cc

        if (shapes_and_types == nullptr) return nullptr;
    
        for (const auto& p : *shapes_and_types) {
          auto* out_shape_and_type = handle_data.add_shape_and_type();
          ic->ShapeHandleToProto(p.shape, out_shape_and_type->mutable_shape());
          out_shape_and_type->set_dtype(p.dtype);
          *out_shape_and_type->mutable_type() = p.type;
        }
      }
      string str_data;
      handle_data.SerializeToString(&str_data);
    
    C++
    - Registered: Tue Apr 23 12:39:09 GMT 2024
    - Last Modified: Mon Apr 15 03:35:10 GMT 2024
    - 102.3K bytes
    - Viewed (0)
  3. tensorflow/c/eager/c_api_unified_experimental.cc

        return nullptr;
      }
      tensorflow::PartialTensorShape partial_shape;
      if (shape.num_dims != -1) {
        DCHECK(shape.dim_sizes != nullptr);
        Status status = tensorflow::PartialTensorShape::MakePartialShape(
            reinterpret_cast<int64_t*>(shape.dim_sizes), shape.num_dims,
            &partial_shape);
        if (!status.ok()) {
          tsl::Set_TF_Status_from_Status(s, status);
          return nullptr;
    C++
    - Registered: Tue Apr 23 12:39:09 GMT 2024
    - Last Modified: Thu Feb 15 09:49:45 GMT 2024
    - 9K bytes
    - Viewed (0)
  4. tensorflow/c/eager/abstract_tensor_handle.cc

    namespace tensorflow {
    
    std::string AbstractTensorHandle::DebugString() const {
      PartialTensorShape shape;
      Status s = Shape(&shape);
      std::string shape_string;
      if (!s.ok()) {
        shape_string = "<error computing shape>";
      } else {
        shape_string = shape.DebugString();
      }
      return absl::StrCat("TensorHandle(shape=", shape_string,
                          ", dtype=", DataType_Name(DataType()),
    C++
    - Registered: Tue Apr 23 12:39:09 GMT 2024
    - Last Modified: Thu Feb 15 09:49:45 GMT 2024
    - 1.4K bytes
    - Viewed (0)
  5. tensorflow/c/c_api_experimental.cc

        ShapeHandle shape_handle = c.output(i);
        TF_ShapeAndType& shape = output_shapes_result->items[i];
        shape.num_dims = c.Rank(shape_handle);
        if (shape.num_dims == InferenceContext::kUnknownRank) {
          shape.dims = nullptr;
          continue;
        }
        shape.dims = new int64_t[shape.num_dims];
        for (size_t j = 0; j < shape.num_dims; ++j) {
          shape.dims[j] = c.Value(c.Dim(shape_handle, j));
    C++
    - Registered: Tue Apr 23 12:39:09 GMT 2024
    - Last Modified: Mon Apr 15 03:35:10 GMT 2024
    - 29.4K bytes
    - Viewed (0)
  6. tensorflow/c/eager/unified_api_test.cc

                           absl::Span<AbstractTensorHandle*> outputs) {
      PartialTensorShape shape;
      TF_RETURN_IF_ERROR(inputs[0]->Shape(&shape));
      if (shape.dims() != 0) {
        return errors::InvalidArgument(
            "Tensor expected to have scalar shape found rank: ", shape.dims());
      }
      return absl::OkStatus();
    }
    
    TEST_P(UnifiedAPI, TestTensorShapeScalar) {
      if (UseFunction() && UseMlir()) {
    C++
    - Registered: Tue Apr 23 12:39:09 GMT 2024
    - Last Modified: Tue Feb 27 13:57:45 GMT 2024
    - 6.7K bytes
    - Viewed (0)
  7. tensorflow/c/checkpoint_reader.cc

      if (reader_ != nullptr) {
        status = reader_->GetTensor(name, out_tensor);
      } else {
        tensorflow::DataType dtype;
        tensorflow::TensorShape shape;
        status = v2_reader_->LookupDtypeAndShape(name, &dtype, &shape);
        if (status.ok()) {
          out_tensor->reset(new Tensor(dtype, shape));
          status = v2_reader_->Lookup(name, out_tensor->get());
          if (!status.ok()) out_tensor->reset();
        }
      }
      if (!status.ok()) {
    C++
    - Registered: Tue Apr 23 12:39:09 GMT 2024
    - Last Modified: Fri Aug 25 21:29:12 GMT 2023
    - 5.5K bytes
    - Viewed (0)
  8. tensorflow/c/eager/immediate_execution_tensor_handle.cc

    namespace tensorflow {
    
    std::string ImmediateExecutionTensorHandle::DebugString() const {
      PartialTensorShape shape;
      std::string shape_string;
      if (Shape(&shape).ok()) {
        shape_string = shape.DebugString();
      } else {
        shape_string = "<error computing shape>";
      }
      std::string value_string;
      if (!SummarizeValue(value_string).ok()) {
        value_string = "<error computing value>";
      }
    C++
    - Registered: Tue Apr 23 12:39:09 GMT 2024
    - Last Modified: Thu Feb 15 09:49:45 GMT 2024
    - 2.1K bytes
    - Viewed (0)
  9. tensorflow/c/experimental/next_pluggable_device/tensor_pjrt_buffer_util_test.cc

      auto c_api_client = down_cast<xla::PjRtCApiClient*>(pjrt_client->get());
      std::vector<int32_t> data(1, 0);
      xla::Shape shape = xla::ShapeUtil::MakeShape(xla::S32, {1});
    
      auto buffer = c_api_client->pjrt_c_client()->client->BufferFromHostBuffer(
          data.data(), shape.element_type(), shape.dimensions(),
          /*byte_strides=*/std::nullopt,
          xla::PjRtClient::HostBufferSemantics::kImmutableOnlyDuringCall, nullptr,
    C++
    - Registered: Tue Feb 27 12:39:08 GMT 2024
    - Last Modified: Mon Oct 30 19:20:20 GMT 2023
    - 7.2K bytes
    - Viewed (0)
  10. tensorflow/c/eager/parallel_device/parallel_device_lib.h

      // devices of a ParallelDevice. If called, ParallelTensor::Shape inspects
      // `components` to determine a shape.
      static std::unique_ptr<ParallelTensor> FromTensorHandles(
          const ParallelDevice& parallel_device,
          std::vector<TensorHandlePtr> components, TF_Status* status);
      // Uses the provided shape without additional checks, which avoids blocking
      // when ParallelTensor::Shape is called.
    C
    - Registered: Tue Apr 23 12:39:09 GMT 2024
    - Last Modified: Tue Apr 25 15:21:13 GMT 2023
    - 12.9K bytes
    - Viewed (0)
Back to top