@@ -80,12 +80,12 @@ class MockMemoryAllocator : public BackendMemoryAllocator
8080 size_t allocated_bytes_{0 };
8181};
8282
83- TEST_CASE (" TensorPtr construction with allocator" , " [tensor]" )
83+ TEST_CASE (" Tensor construction with allocator" , " [tensor]" )
8484{
8585 auto allocator = std::make_shared<MockMemoryAllocator>();
8686 std::vector<size_t > shape{2 , 3 , 4 };
8787
88- TensorPtr tensor (shape, DataType::FLOAT32, allocator);
88+ Tensor tensor (shape, DataType::FLOAT32, allocator);
8989
9090 REQUIRE (tensor.shape () == shape);
9191 REQUIRE (tensor.dtype () == DataType::FLOAT32);
@@ -94,20 +94,20 @@ TEST_CASE("TensorPtr construction with allocator", "[tensor]")
9494 REQUIRE (allocator->allocated_bytes () > 0 );
9595}
9696
97- TEST_CASE (" TensorPtr construction without allocator throws" , " [tensor]" )
97+ TEST_CASE (" Tensor construction without allocator throws" , " [tensor]" )
9898{
9999 std::vector<size_t > shape{2 , 3 };
100- REQUIRE_THROWS_AS (TensorPtr (shape, DataType::FLOAT32), std::runtime_error);
100+ REQUIRE_THROWS_AS (Tensor (shape, DataType::FLOAT32), std::runtime_error);
101101}
102102
103103TEST_CASE (" Different data types have correct sizes" , " [tensor]" )
104104{
105105 auto allocator = std::make_shared<MockMemoryAllocator>();
106106
107- TensorPtr float_tensor ({10 }, DataType::FLOAT32, allocator);
108- TensorPtr int32_tensor ({10 }, DataType::INT32, allocator);
109- TensorPtr int64_tensor ({10 }, DataType::INT64, allocator);
110- TensorPtr uint8_tensor ({10 }, DataType::UINT8, allocator);
107+ Tensor float_tensor ({10 }, DataType::FLOAT32, allocator);
108+ Tensor int32_tensor ({10 }, DataType::INT32, allocator);
109+ Tensor int64_tensor ({10 }, DataType::INT64, allocator);
110+ Tensor uint8_tensor ({10 }, DataType::UINT8, allocator);
111111
112112 REQUIRE (float_tensor.size () == 10 );
113113 REQUIRE (int32_tensor.size () == 10 );
@@ -120,15 +120,15 @@ TEST_CASE("Empty shape throws exception", "[tensor]")
120120 auto allocator = std::make_shared<MockMemoryAllocator>();
121121 std::vector<size_t > empty_shape;
122122
123- REQUIRE_THROWS_AS (TensorPtr (empty_shape, DataType::FLOAT32, allocator), std::invalid_argument);
123+ REQUIRE_THROWS_AS (Tensor (empty_shape, DataType::FLOAT32, allocator), std::invalid_argument);
124124}
125125
126126TEST_CASE (" Large shape allocation" , " [tensor]" )
127127{
128128 auto allocator = std::make_shared<MockMemoryAllocator>();
129129 std::vector<size_t > large_shape{100 , 100 , 3 };
130130
131- TensorPtr tensor (large_shape, DataType::UINT8, allocator);
131+ Tensor tensor (large_shape, DataType::UINT8, allocator);
132132
133133 REQUIRE (tensor.size () == 30000 );
134134 REQUIRE (tensor.shape () == large_shape);
@@ -144,15 +144,15 @@ class MockBackendExecutor : public BackendInferenceExecutor
144144 return true ;
145145 }
146146
147- TensorPtr run_inference (TensorPtr input) override
147+ Tensor run_inference (Tensor input) override
148148 {
149149 if (!model_loaded_) {
150150 throw std::runtime_error (" No model loaded" );
151151 }
152152
153153 // Mock inference: return tensor with same shape but all zeros
154154 auto allocator = std::make_shared<MockMemoryAllocator>();
155- TensorPtr output (input.shape (), input.dtype (), allocator);
155+ Tensor output (input.shape (), input.dtype (), allocator);
156156
157157 // Calculate correct byte size based on data type
158158 size_t dtype_size = get_dtype_size (input.dtype ());
@@ -242,7 +242,7 @@ TEST_CASE("Backend inference workflow", "[plugin][inference]")
242242
243243 // Create input tensor
244244 std::vector<size_t > shape{1 , 3 , 224 , 224 };
245- TensorPtr input (shape, DataType::FLOAT32, allocator);
245+ Tensor input (shape, DataType::FLOAT32, allocator);
246246
247247 // Run inference
248248 auto output = executor->run_inference (std::move (input));
@@ -280,7 +280,7 @@ class TestInferenceNode : public DeepNodeBase
280280 return load_model (model_path);
281281 }
282282
283- TensorPtr test_run_inference (TensorPtr input)
283+ Tensor test_run_inference (Tensor input)
284284 {
285285 return run_inference (input);
286286 }
0 commit comments