Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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)))
}
}

Expand Down