Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 506 for capsule (0.16 sec)

  1. tensorflow/cc/experimental/libtf/value.h

        return v;
      }
    
      /// Constructs a TaggedValue with type CAPSULE with a default destructor.
      template <class T>
      static TaggedValue Capsule(T* data) {
        return Capsule(static_cast<void*>(data),
                       [](void* x) { delete static_cast<T*>(x); });
      }
      /// Constructs a TaggedValue with type CAPSULE with a custom destructor.
      static TaggedValue Capsule(void* data, void (*deleter)(void*)) {
        TaggedValue v;
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Sat Apr 13 05:23:45 UTC 2024
    - 20.4K bytes
    - Viewed (0)
  2. tensorflow/cc/experimental/libtf/tests/value_test.cc

      ASSERT_EQ(alloc_count, 0);
      void* ptr_value = new Cool();
      {
        TaggedValue capsule =
            TaggedValue::Capsule(static_cast<void*>(ptr_value),
                                 [](void* x) { delete static_cast<Cool*>(x); });
        ASSERT_EQ(alloc_count, 1);
        ASSERT_EQ(capsule.capsule(), ptr_value);
        test_moved = std::move(capsule);
        ASSERT_EQ(capsule.type(), TaggedValue::NONE);  // NOLINT
        test_copy = test_moved;
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Sep 01 11:18:25 UTC 2022
    - 3.4K bytes
    - Viewed (0)
  3. tensorflow/cc/experimental/libtf/mlir/mlir_transform.cc

      // transforms.
      // auto obj = TaggedValue::Dict();
      Object obj;
      obj.Set(
          String("_module"),
          Handle(impl::TaggedValue::Capsule(new mlir::OwningOpRef<mlir::ModuleOp>(
              std::move(module_or).value()))));
    
      auto get_string = [](Object self) {
        auto ref = self.Get<internal::Capsule>(String("_module"))
                       ->cast<mlir::OwningOpRef<mlir::ModuleOp>*>();
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Tue Jul 12 16:28:19 UTC 2022
    - 3K bytes
    - Viewed (0)
  4. tensorflow/cc/experimental/libtf/tests/object_test.cc

      EXPECT_EQ(val.get(), 3);
    }
    
    TEST(ObjectTest, Capsule) {
      Object obj;
      int* hundred = new int(100);
      Handle capsule =
          Handle(TaggedValue::Capsule(static_cast<void*>(hundred), [](void* p) {
            delete static_cast<int*>(p);
          }));
      obj.Set(String("hundred"), capsule);
      EXPECT_EQ(*static_cast<int*>(
                    obj.Get<internal::Capsule>(String("hundred"))->cast<int*>()),
                100);
    }
    
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Wed Jul 28 21:37:07 UTC 2021
    - 5.7K bytes
    - Viewed (0)
  5. tensorflow/cc/experimental/libtf/value_iostream.h

        OutList(o_, x->begin(), x->end(), '(', ')');
        return o_;
      }
      std::ostream& operator()(const DictPtr& x) {
        o_ << *x;
        return o_;
      }
      std::ostream& operator()(const Capsule& x) {
        o_ << "Capsule(" << x.get() << ")";
        return o_;
      }
      std::ostream& operator()(const Func& x) {
        o_ << "Func";
        return o_;
      }
      std::ostream& operator()(const TaggedValueTensor& x) {
        o_ << "Tensor";
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Tue Aug 30 21:44:45 UTC 2022
    - 2.4K bytes
    - Viewed (0)
  6. tensorflow/cc/experimental/libtf/runtime/runtime.h

            num_elements, "\n", "Data size: ", data.size(), "\n"));
      }
      auto maybe_capsule = Get<internal::Capsule>(String("ctx"));
      if (!maybe_capsule.status().ok()) {
        return maybe_capsule.status();
      }
      auto capsule = maybe_capsule.value();
      auto ctx = capsule.cast<tensorflow::ImmediateExecutionContext*>();
      tensorflow::AbstractTensorPtr t(
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Sep 01 11:18:25 UTC 2022
    - 4.4K bytes
    - Viewed (0)
  7. tensorflow/cc/experimental/libtf/tests/tensor_test.cc

    TaggedValue MakeContext(T runtime) {
      AbstractContext* ctx_raw = nullptr;
      Status s = BuildImmediateExecutionContext(runtime, &ctx_raw);
      // ASSERT_EQ(tensorflow::errors::OK, s.code()) << s.message();
      return TaggedValue::Capsule(static_cast<void*>(ctx_raw), [](void* p) {
        tensorflow::internal::AbstractContextDeleter()(
            static_cast<AbstractContext*>(p));
      });
    }
    }  // namespace
    
    TEST_P(UnifiedCAPI, HoldTensors) {
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Fri May 19 21:44:52 UTC 2023
    - 5K bytes
    - Viewed (0)
  8. tensorflow/cc/experimental/libtf/object.h

    };
    
    namespace internal {
    /// @brief The Capsule class for holding pointers.
    class Capsule final : public Handle {
     public:
      /// Statically cast the TaggedValue capsule to type `T`.
      template <class T>
      T cast() {
        return static_cast<T>(value_.capsule());
      }
    
     private:
      // Private since it is in general unsafe.
      explicit Capsule(TaggedValue v) : Handle(std::move(v)) {}
      template <class T>
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu May 11 08:05:36 UTC 2023
    - 23.6K bytes
    - Viewed (0)
  9. tensorflow/cc/experimental/libtf/runtime/runtime.cc

    Runtime::Runtime(AbstractContext* ctx) {
      TaggedValue ctx_capsule =
          TaggedValue::Capsule(static_cast<void*>(ctx), [](void* p) {
            auto ctx = static_cast<AbstractContext*>(p);
            ctx->Release();
          });
      Set(String("ctx"), Handle(ctx_capsule));
      auto Load = [](Object self, String name) -> Object {
        auto ctx_capsule = self.Get<internal::Capsule>(String("ctx")).value();
        auto ctx = ctx_capsule.cast<AbstractContext*>();
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Sep 01 11:18:25 UTC 2022
    - 7.4K bytes
    - Viewed (0)
  10. releasenotes/notes/agent-dns-capture.yaml

    John Howard <******@****.***> 1602131566 -0700
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Thu Oct 08 04:32:46 UTC 2020
    - 1.1K bytes
    - Viewed (0)
Back to top