We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent dceb95a commit 90c1ae5Copy full SHA for 90c1ae5
src/pb_tensor.cc
@@ -515,12 +515,18 @@ PbTensor::Name() const
515
const py::array*
516
PbTensor::AsNumpy() const
517
{
518
- if (IsCPU()) {
519
- return &numpy_array_;
520
- } else {
+ if (!IsCPU()) {
521
throw PythonBackendException(
522
"Tensor is stored in GPU and cannot be converted to NumPy.");
523
}
+
+ if (dtype_ == TRITONSERVER_TYPE_BF16) {
524
+ throw PythonBackendException(
525
+ "Tensor dtype is BF16 and cannot be converted to NumPy. Use "
526
+ "to_dlpack() and from_dlpack() instead.");
527
+ }
528
529
+ return &numpy_array_;
530
531
#endif // TRITON_PB_STUB
532
0 commit comments