altavir
10/17/2021, 8:04 AMBailey Pollard
10/17/2021, 1:53 PMBailey Pollard
10/17/2021, 1:53 PMaltavir
10/17/2021, 1:55 PMrusshwolf
10/17/2021, 3:17 PMaltavir
10/17/2021, 3:18 PMrusshwolf
10/17/2021, 3:19 PMaltavir
10/17/2021, 3:19 PMrusshwolf
10/17/2021, 3:24 PMdefaultStridesCache
that's causing the error, as opposed to shape
or something inside the DefaultStrides
constructor?russhwolf
10/17/2021, 3:25 PMinit { defaultStridesCache.ensureNeverFrozen() }
and see if you get any more insightaltavir
10/17/2021, 3:25 PMaltavir
10/17/2021, 3:27 PMkotlin.native.concurrent.InvalidMutabilityException: mutation attempt of frozen kotlin.collections.HashMap@a88e18
kotlin.native.concurrent.InvalidMutabilityException: mutation attempt of frozen kotlin.collections.HashMap@a88e18
at kfun:kotlin.Throwable#<init>(kotlin.String?;kotlin.Throwable?){} (0000000000414080)
at kfun:kotlin.Throwable#<init>(kotlin.String?){} (0000000000414390)
at kfun:kotlin.Exception#<init>(kotlin.String?){} (000000000040dc10)
at kfun:kotlin.RuntimeException#<init>(kotlin.String?){} (000000000040dd40)
at kfun:kotlin.native.concurrent.InvalidMutabilityException#<init>(kotlin.String){} (0000000000437710)
at ThrowInvalidMutabilityException (0000000000438a60)
at MutationCheck (00000000005d4a10)
at kfun:kotlin.collections.HashMap.<set-length>#internal (0000000000420980)
at kfun:kotlin.collections.HashMap#addKey(1:0){}<http://kotlin.Int|kotlin.Int> (0000000000424800)
at kfun:kotlin.collections.HashMap#put(1:0;1:1){}1:1? (00000000004218c0)
at kfun:space.kscience.kmath.nd.DefaultStrides.Companion#invoke(kotlin.IntArray){}space.kscience.kmath.nd.Strides (0000000000524d40)
russhwolf
10/17/2021, 3:28 PMensureNeverFrozen()
to see what's freezing italtavir
10/17/2021, 3:30 PMrusshwolf
10/17/2021, 3:31 PMrusshwolf
10/17/2021, 3:31 PMrusshwolf
10/17/2021, 3:32 PMaltavir
10/17/2021, 3:34 PM@ThreadLocal
private val defaultStridesCache = HashMap<IntArray, Strides>()
solves the problem.russhwolf
10/17/2021, 3:35 PMaltavir
10/17/2021, 3:36 PM