16
16
#include " deserialization.hpp"
17
17
18
18
#include " capi_frontend/buffer.hpp"
19
+ #include " logging.hpp"
19
20
20
21
namespace ovms {
21
22
@@ -24,6 +25,7 @@ Status InputSink<ov::InferRequest&>::give(const std::string& name, ov::Tensor& t
24
25
OVMS_PROFILE_FUNCTION ();
25
26
Status status;
26
27
try {
28
+ OV_LOGGER (" ov::InferRequest: {}, request.set_tensor({}, tensor)" , reinterpret_cast <void *>(&requester), name, reinterpret_cast <void *>(&tensor));
27
29
requester.set_tensor (name, tensor);
28
30
// OV implementation the ov::Exception is not
29
31
// a base class for all other exceptions thrown from OV.
@@ -43,56 +45,70 @@ Status InputSink<ov::InferRequest&>::give(const std::string& name, ov::Tensor& t
43
45
ov::Tensor makeTensor (const InferenceTensor& requestInput,
44
46
const std::shared_ptr<const TensorInfo>& tensorInfo) {
45
47
OVMS_PROFILE_FUNCTION ();
48
+ OV_LOGGER (" ov::Shape()" );
46
49
ov::Shape shape;
47
50
for (const auto & dim : requestInput.getShape ()) {
51
+ OV_LOGGER (" ov::Shape::push_back({})" , dim);
48
52
shape.push_back (dim);
49
53
}
50
54
ov::element::Type_t precision = tensorInfo->getOvPrecision ();
51
55
if (!requestInput.getBuffer ()->getByteSize ()) {
56
+ OV_LOGGER (" ov::Tensor({}, shape)" , toString (ovms::ovElementTypeToOvmsPrecision (precision)));
52
57
return ov::Tensor (precision, shape);
53
58
}
59
+ OV_LOGGER (" ov::Tensor({}, shape, data)" , toString (ovms::ovElementTypeToOvmsPrecision (precision)));
54
60
return ov::Tensor (precision, shape, const_cast <void *>(reinterpret_cast <const void *>(requestInput.getBuffer ()->data ())));
55
61
}
56
62
57
63
ov::Tensor makeTensor (const tensorflow::TensorProto& requestInput,
58
64
const std::shared_ptr<const TensorInfo>& tensorInfo) {
59
65
OVMS_PROFILE_FUNCTION ();
66
+ OV_LOGGER (" ov::Shape()" );
60
67
ov::Shape shape;
61
68
for (int i = 0 ; i < requestInput.tensor_shape ().dim_size (); i++) {
69
+ OV_LOGGER (" ov::Shape::push_back(dim)" );
62
70
shape.push_back (requestInput.tensor_shape ().dim (i).size ());
63
71
}
64
72
ov::element::Type_t precision = tensorInfo->getOvPrecision ();
65
73
if (!requestInput.tensor_content ().size ()) {
74
+ OV_LOGGER (" ov::Tensor({}, shape)" , toString (ovms::ovElementTypeToOvmsPrecision (precision)));
66
75
return ov::Tensor (precision, shape);
67
76
}
77
+ OV_LOGGER (" ov::Tensor({}, shape, data)" , toString (ovms::ovElementTypeToOvmsPrecision (precision)));
68
78
return ov::Tensor (precision, shape, const_cast <void *>(reinterpret_cast <const void *>(requestInput.tensor_content ().data ())));
69
79
}
70
80
71
81
ov::Tensor makeTensor (const ::KFSRequest::InferInputTensor& requestInput,
72
82
const std::shared_ptr<const TensorInfo>& tensorInfo,
73
83
const std::string& buffer) {
74
84
OVMS_PROFILE_FUNCTION ();
85
+ OV_LOGGER (" ov::Shape()" );
75
86
ov::Shape shape;
76
87
for (int i = 0 ; i < requestInput.shape_size (); i++) {
88
+ OV_LOGGER (" ov::Shape::push_back({})" , requestInput.shape ().at (i));
77
89
shape.push_back (requestInput.shape ().at (i));
78
90
}
79
91
ov::element::Type precision = tensorInfo->getOvPrecision ();
80
92
if (!buffer.size ()) {
93
+ OV_LOGGER (" ov::Tensor({}, shape)" , toString (ovms::ovElementTypeToOvmsPrecision (precision)));
81
94
return ov::Tensor (precision, shape);
82
95
}
96
+ OV_LOGGER (" ov::Tensor({}, shape, data)" , toString (ovms::ovElementTypeToOvmsPrecision (precision)));
83
97
return ov::Tensor (precision, shape, const_cast <void *>(reinterpret_cast <const void *>(buffer.data ())));
84
98
}
85
99
ov::Tensor makeTensor (const ::KFSRequest::InferInputTensor& requestInput,
86
100
const std::shared_ptr<const TensorInfo>& tensorInfo) {
87
101
OVMS_PROFILE_FUNCTION ();
102
+ OV_LOGGER (" ov::Shape()" );
88
103
ov::Shape shape;
89
104
for (int i = 0 ; i < requestInput.shape_size (); i++) {
105
+ OV_LOGGER (" ov::Shape::push_back({})" , requestInput.shape ().at (i));
90
106
shape.push_back (requestInput.shape ().at (i));
91
107
}
92
108
93
109
ov::element::Type precision = tensorInfo->getOvPrecision ();
110
+ OV_LOGGER (" ov::Tensor({}, shape)" , toString (ovms::ovElementTypeToOvmsPrecision (precision)));
94
111
ov::Tensor tensor (precision, shape);
95
112
return tensor;
96
113
}
97
-
98
114
} // namespace ovms
0 commit comments