- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 10 for cpu_allocator (0.16 sec)
-
tensorflow/c/tf_tensor.cc
} return data; } void* allocate_tensor(const char* operation, size_t len) { return allocate_tensor(operation, len, cpu_allocator()); } void deallocate_buffer(void* data, size_t len, void* arg) { Allocator* allocator = nullptr; if (arg == nullptr) { allocator = cpu_allocator(); } else { allocator = reinterpret_cast<Allocator*>(arg); } if (LogMemory::IsEnabled() && data != nullptr) {
Registered: Sun Jun 16 05:45:23 UTC 2024 - Last Modified: Sun Apr 14 21:57:32 UTC 2024 - 11.5K bytes - Viewed (0) -
tensorflow/compiler/jit/pjrt_tensor_buffer_util_test.cc
DeviceSetup device_setup; device_setup.AddDevicesAndSetUp({DEVICE_GPU}); Device* device = device_setup.GetDevice(DEVICE_GPU); std::vector<int64_t> dimensions = {2, 3}; Tensor dest_cpu_tensor(cpu_allocator(), tensorflow::DT_INT32, tensorflow::TensorShape(dimensions)); TF_ASSERT_OK_AND_ASSIGN(auto pjrt_client, GetPjRtClient(DEVICE_GPU)); std::vector<int32_t> data{1, 2, 3, 4, 5, 6};
Registered: Sun Jun 16 05:45:23 UTC 2024 - Last Modified: Thu Sep 14 18:14:47 UTC 2023 - 2.7K bytes - Viewed (0) -
tensorflow/c/kernels/bitcast_op_test.cc
namespace tensorflow { namespace { class DummyDevice : public DeviceBase { public: explicit DummyDevice(Env* env) : DeviceBase(env) {} Allocator* GetAllocator(AllocatorAttributes /*attr*/) override { return cpu_allocator(); } }; void TestBitcastOp(Tensor* input_tensor, DataType out_type, TensorShape expected_shape, error::Code expected_code) { Status status; NodeDef def; def.set_op("Bitcast");
Registered: Sun Jun 16 05:45:23 UTC 2024 - Last Modified: Mon Jul 18 15:10:51 UTC 2022 - 5.5K bytes - Viewed (0) -
tensorflow/compiler/jit/kernels/xla_ops.cc
host_alloc_attrs.set_on_host(true); Allocator* cpu_allocator = ctx->device()->GetAllocator(host_alloc_attrs); // Async compilation returns nullptr executable without an error. if (!executable && !pjrt_executable) { DCHECK(!must_compile_); Tensor compilation_key(cpu_allocator, DT_STRING, TensorShape({})); Tensor compilation_successful(cpu_allocator, DT_BOOL, TensorShape({}));
Registered: Sun Jun 16 05:45:23 UTC 2024 - Last Modified: Fri May 17 22:46:36 UTC 2024 - 41.4K bytes - Viewed (0) -
tensorflow/c/tf_tensor_internal.h
void FillAllocationDescription( tensorflow::AllocationDescription* proto) const override { int64_t rb = size(); proto->set_requested_bytes(rb); proto->set_allocator_name(tensorflow::cpu_allocator()->Name()); } bool OwnsMemory() const override { return owns_memory_; } private: const size_t len_; void (*const deallocator_)(void* data, size_t len, void* arg); void* const deallocator_arg_;
Registered: Sun Jun 16 05:45:23 UTC 2024 - Last Modified: Thu Aug 24 20:38:55 UTC 2023 - 4.6K bytes - Viewed (0) -
tensorflow/c/kernels/summary_op_test.cc
namespace tensorflow { namespace { class DummyDevice : public DeviceBase { public: explicit DummyDevice(Env* env) : DeviceBase(env) {} Allocator* GetAllocator(AllocatorAttributes /*attr*/) override { return cpu_allocator(); } }; // Helper for comparing output and expected output void ExpectSummaryMatches(const Summary& actual, const string& expected_str) { Summary expected;
Registered: Sun Jun 16 05:45:23 UTC 2024 - Last Modified: Mon Jul 18 15:10:51 UTC 2022 - 6.7K bytes - Viewed (0) -
tensorflow/compiler/jit/xla_device.cc
mutex_lock lock(mu_); return GetAllocatorLocked(attr); } Allocator* XlaDevice::GetAllocatorLocked(AllocatorAttributes attr) { if (attr.on_host()) { return cpu_allocator(); } if (xla_allocator_ == nullptr) { if (UsePjRtForSingleDeviceCompilation(device_name_)) { VLOG(1) << "XlaDevice " << this << " uses AsyncValueAllocator";
Registered: Sun Jun 16 05:45:23 UTC 2024 - Last Modified: Mon May 20 21:05:42 UTC 2024 - 24.3K bytes - Viewed (0) -
tensorflow/c/c_api_test.cc
TF_DeleteStatus(s); } void Deallocator(void* data, size_t, void* arg) { tensorflow::cpu_allocator()->DeallocateRaw(data); *reinterpret_cast<bool*>(arg) = true; } TEST(CAPI, Tensor) { const int num_bytes = 6 * sizeof(float); float* values = reinterpret_cast<float*>(tensorflow::cpu_allocator()->AllocateRaw( TF_TensorDefaultAlignment(), num_bytes)); int64_t dims[] = {2, 3};
Registered: Sun Jun 16 05:45:23 UTC 2024 - Last Modified: Mon Apr 15 03:35:10 UTC 2024 - 96.9K bytes - Viewed (0) -
tensorflow/c/kernels_experimental.cc
// DT_VARIANT tensors must be allocated on CPU since they wrap C++ // objects which can not be efficiently represented in GPU memory. int numa_node = cc_ctx->device()->NumaNode(); Tensor out(::tensorflow::cpu_allocator(numa_node), ::tensorflow::DT_VARIANT, ::tensorflow::TensorShape({})); Variant* out_v = &(out.scalar<Variant>()()); Status cc_status = ZerosLikeVariant(cc_ctx, v, out_v, zeros_like_func);
Registered: Sun Jun 16 05:45:23 UTC 2024 - Last Modified: Tue Apr 23 06:12:29 UTC 2024 - 30.9K bytes - Viewed (0) -
tensorflow/c/kernels_test.cc
} #undef EXPECT_TF_SIZE class DummyDevice : public DeviceBase { public: explicit DummyDevice(Env* env) : DeviceBase(env) {} Allocator* GetAllocator(AllocatorAttributes /*attr*/) override { return cpu_allocator(); } }; TEST(TestKernel, TestInputAndOutputCount) { const char* node_name = "InputOutputCounterKernel"; const char* op_name = "BarOp"; const char* device_name = "FakeDeviceName2";
Registered: Sun Jun 16 05:45:23 UTC 2024 - Last Modified: Wed Sep 06 19:12:29 UTC 2023 - 50.4K bytes - Viewed (0)