@@ -152,6 +152,21 @@ Tensor<std::remove_const_t<T>, D> tril(const TensorView<T, D>& tensor, const boo
152152 return out;
153153}
154154
155+ template <typename T, typename D>
156+ Tensor<std::remove_const_t <T>, D> cos (const TensorView<T, D>& tensor) {
157+ return tensor.template map <std::remove_const_t <T>>([](T val) { return std::cos (val); });
158+ }
159+
160+ template <typename T, typename D>
161+ Tensor<std::remove_const_t <T>, D> sin (const TensorView<T, D>& tensor) {
162+ return tensor.template map <std::remove_const_t <T>>([](T val) { return std::sin (val); });
163+ }
164+
165+ template <typename T, typename D>
166+ Tensor<std::remove_const_t <T>, D> exp (const TensorView<T, D>& tensor) {
167+ return tensor.template map <std::remove_const_t <T>>([](T val) { return std::exp (val); });
168+ }
169+
155170template <typename T, typename D>
156171Tensor<std::remove_const_t <T>, D> pow (std::remove_const_t <T> scalar,
157172 const TensorView<T, D>& tensor) {
@@ -578,9 +593,15 @@ template Tensor<float, CPU> max(const TensorView<float, CPU>&, int, bool);
578593template Tensor<bfloat16, CPU> masked_fill (const TensorView<bfloat16, CPU>&,
579594 const TensorView<int , CPU>&, bfloat16);
580595
596+ // cat
581597template Tensor<bfloat16, CPU> cat (const TensorView<bfloat16, CPU>&,
582598 const TensorView<bfloat16, CPU>&, int );
583599template Tensor<float , CPU> cat (const TensorView<float , CPU>&, const TensorView<float , CPU>&, int );
600+
601+ template Tensor<float , CPU> cos (const TensorView<float , CPU>& tensor);
602+ template Tensor<float , CPU> sin (const TensorView<float , CPU>& tensor);
603+ template Tensor<float , CPU> exp (const TensorView<float , CPU>& tensor);
604+
584605template Tensor<bfloat16, CPU> pow (bfloat16, const TensorView<bfloat16, CPU>&);
585606template Tensor<float , CPU> pow (const TensorView<float , CPU>&, float );
586607template Tensor<float , CPU> pow (float , const TensorView<float , CPU>&);
0 commit comments