From 013a3c7f96100c7e4a1568c58b52fc00d52413cb Mon Sep 17 00:00:00 2001 From: Yang Bo Date: Fri, 27 Apr 2018 14:40:48 +0800 Subject: [PATCH] Add TensorLayerDebugging type --- .../deeplearning/plugins/TensorLayers.scala | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/plugins-TensorLayers/src/main/scala/com/thoughtworks/deeplearning/plugins/TensorLayers.scala b/plugins-TensorLayers/src/main/scala/com/thoughtworks/deeplearning/plugins/TensorLayers.scala index 5c35e80c..bc31f28d 100644 --- a/plugins-TensorLayers/src/main/scala/com/thoughtworks/deeplearning/plugins/TensorLayers.scala +++ b/plugins-TensorLayers/src/main/scala/com/thoughtworks/deeplearning/plugins/TensorLayers.scala @@ -81,15 +81,21 @@ trait TensorLayers extends Tensors with Layers { protected val tensorPartialApplyRawForward: PartialApply[tensorLayerFactory.Constructor, shapeless.Witness.`"rawForward"`.T] + /** Contains line number, caller and other debugging information for [[TensorLayer]] + * @documentable + */ + type TensorLayerDebugging[Out <: TensorLayer] = ImplicitApply.Aux[tensorPartialApplyRawForward.Rest, Out] + object TensorLayer { - /** @usecase def apply(forward: Do[Tape[Tensor, Tensor]]): TensorLayer = ??? + /** Returns a [[TensorLayer]] according to the given `forward` operation. * - * Returns a [[TensorLayer]] according to the given `forward` operation. + * @usecase def apply(forward: Do[Tape[Tensor, Tensor]]): TensorLayer = ??? */ def apply[Out <: TensorLayer](forward: Do[Tape[Tensor, Tensor]])( - implicit implicitApply: ImplicitApply.Aux[tensorPartialApplyRawForward.Rest, Out]): Out = { - implicitApply(tensorPartialApplyRawForward(tensorLayerFactory.newInstance, tensorRawForwardParameter(forward))) + implicit debuggingInformation: TensorLayerDebugging[Out]): Out = { + debuggingInformation( + tensorPartialApplyRawForward(tensorLayerFactory.newInstance, tensorRawForwardParameter(forward))) } }