diff src/LazyTensors/lazy_tensor_operations.jl @ 457:8fb6a5611c7a feature/inflated_tensormapping

Add tests and docs for flatten_tuple
author Jonatan Werpers <jonatan@werpers.com>
date Wed, 21 Oct 2020 20:10:27 +0200
parents 8f4c31e06689
children 41f9cb6ee5a7
line wrap: on
line diff
--- a/src/LazyTensors/lazy_tensor_operations.jl	Wed Oct 21 19:53:36 2020 +0200
+++ b/src/LazyTensors/lazy_tensor_operations.jl	Wed Oct 21 20:10:27 2020 +0200
@@ -253,6 +253,11 @@
     return ntuple(i->t[i+L-1], U-L+1)
 end
 
+"""
+    flatten_tuple(t)
+
+Takes a nested tuple and flattens the whole structure
+"""
 flatten_tuple(t::NTuple{N, Number} where N) = t
 flatten_tuple(t::Tuple) = ((flatten_tuple.(t)...)...,) # simplify?
 flatten_tuple(ts::Vararg) = flatten_tuple(ts)