Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add TensorLayerDebugging type #198

Open
wants to merge 1 commit into
base: 3.0.x
Choose a base branch
from
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