MCPcopy Create free account
hub / github.com/MrNeRF/LichtFeld-Studio / make_external_float_tensor

Function make_external_float_tensor

tests/test_scene_validity.cpp:60–77  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

58 }
59
60 core::Tensor make_external_float_tensor(
61 std::vector<std::shared_ptr<std::vector<float>>>& owners,
62 core::TensorShape shape,
63 const size_t capacity,
64 std::string kind = "splat.exportable") {
65 const size_t element_count = std::max(shape.elements(), capacity);
66 auto owner = std::make_shared<std::vector<float>>(element_count, 0.0f);
67 auto* data = owner->data();
68 owners.push_back(owner);
69 return core::Tensor::from_external_owner(data,
70 std::move(shape),
71 core::Device::CPU,
72 core::DataType::Float32,
73 std::move(owner),
74 capacity,
75 nullptr,
76 std::move(kind));
77 }
78
79 void expect_sh_degree(const core::SplatData& splat,
80 const int max_sh_degree,

Callers 1

TEST_FFunction · 0.85

Calls 4

moveFunction · 0.85
maxFunction · 0.50
dataMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected