#pragma once #include "op.h" namespace ctranslate2 { namespace ops { class Split : public Op { public: Split(dim_t axis, bool no_copy = false); Split(dim_t axis, const std::vector& split, bool no_copy = false); void operator()(const StorageView& input, StorageView& output1, StorageView& output2) const; void operator()(const StorageView& input, StorageView& output1, StorageView& output2, StorageView& output3) const; void operator()(const StorageView& input, std::vector& outputs) const; private: dim_t _axis; std::vector _split; dim_t _total_size; bool _no_copy; void check_arguments() const; template void compute(const StorageView& input, std::vector& outputs) const; }; } }