From 3c4be29bbb8a875823d638781db3555ac4557725 Mon Sep 17 00:00:00 2001 From: Svyatoslav Scherbina Date: Wed, 29 Jul 2020 20:20:45 +0300 Subject: [PATCH] torch sample: add note about resource management --- samples/torch/src/torchMain/kotlin/Disposable.kt | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/samples/torch/src/torchMain/kotlin/Disposable.kt b/samples/torch/src/torchMain/kotlin/Disposable.kt index 2d275137d26..2e94e0ed718 100644 --- a/samples/torch/src/torchMain/kotlin/Disposable.kt +++ b/samples/torch/src/torchMain/kotlin/Disposable.kt @@ -5,6 +5,15 @@ package sample.torch +/** + * NOTE: resource management in this sample suffers from resource leaks + * and double-free bugs (see workaround in [FloatTensor.dispose]). + * + * This might mean that the entire approach for resource management in the sample is faulty. + * Please take this into account when considering reusing the same approach in your project. + * + * TODO: rework resource management. +*/ interface Disposable { fun dispose() }