diff --git a/docs/src/dev/adding_overloads.md b/docs/src/dev/adding_overloads.md index 2a74ac8..198a18e 100644 --- a/docs/src/dev/adding_overloads.md +++ b/docs/src/dev/adding_overloads.md @@ -123,19 +123,13 @@ Depending on the type of function you're dealing with, you will have to specify ## [Overloading](@id code-gen) After implementing the required classification methods for a function, the function has not been overloaded on our tracer types yet. -SCT provides six functions that generate code via meta-programming: +SCT provides three functions that generate code via meta-programming: -* 1-to-1 - * `eval(SCT.generate_code_gradient_1_to_1(module_symbol, f))` - * `eval(SCT.generate_code_hessian_1_to_1(module_symbol, f))` -* 2-to-1 - * `eval(SCT.generate_code_gradient_1_to_2(module_symbol, f))` - * `eval(SCT.generate_code_hessian_1_to_2(module_symbol, f))` -* 1-to-2 - * `eval(SCT.generate_code_gradient_2_to_1(module_symbol, f))` - * `eval(SCT.generate_code_hessian_2_to_1(module_symbol, f))` +* 1-to-1: `eval(SCT.generate_code_1_to_1(module_symbol, f))` +* 2-to-1: `eval(SCT.generate_code_1_to_2(module_symbol, f))` +* 1-to-2: `eval(SCT.generate_code_2_to_1(module_symbol, f))` -You are required to call the two functions that match your type of operator. +You are required to call the function that matches your type of operator. !!! tip "Code generation" We will take a look at the code generation mechanism in the example below. @@ -170,17 +164,16 @@ The `relu` function has not been overloaded on our tracer types yet. Let's call the code generation utilities from the [*"Overloading"*](@ref code-gen) section for this purpose: ```@example overload -eval(SCT.generate_code_gradient_1_to_1(:NNlib, relu)) -eval(SCT.generate_code_hessian_1_to_1(:NNlib, relu)) +eval(SCT.generate_code_1_to_1(:NNlib, relu)) ``` The `relu` function is now ready to be called with SCT's tracer types. !!! details "What is the eval call doing?" - Let's call `generate_code_gradient_1_to_1` without wrapping it `eval`: + Let's call `generate_code_1_to_1` without wrapping it `eval`: ```@example overload - SCT.generate_code_gradient_1_to_1(:NNlib, relu) + SCT.generate_code_1_to_1(:NNlib, relu) ``` As you can see, this returns a `quote`, a type of expression containing our generated Julia code.