diff --git a/modules/basic/ds/tensor.vineyard-mod b/modules/basic/ds/tensor.vineyard-mod index 996cbe8c..572f2d96 100644 --- a/modules/basic/ds/tensor.vineyard-mod +++ b/modules/basic/ds/tensor.vineyard-mod @@ -57,10 +57,23 @@ class ITensor : public Object { [[shared]] virtual const std::shared_ptr buffer() const = 0; }; +namespace detail { + +template +struct ArrowTensorType { + using type = arrow::NumericTensor::ArrowType>; +}; + +template <> +struct ArrowTensorType { + using type = void; +}; + +} // namespace detail + template class [[vineyard]] Tensor : public ITensor, public BareRegistered> { - using ArrowTensorT = - arrow::NumericTensor::ArrowType>; + using ArrowTensorT = typename detail::ArrowTensorType::type; public: /** @@ -129,6 +142,7 @@ class [[vineyard]] Tensor : public ITensor, public BareRegistered> { * arrow's Tensor. * */ + template ::value>> [[shared]] const std::shared_ptr ArrowTensor() { return std::make_shared(buffer_->Buffer(), shape()); }