Skip to content

Commit

Permalink
Tidy up writing
Browse files Browse the repository at this point in the history
  • Loading branch information
willtebbutt committed Jan 3, 2025
1 parent bec5da4 commit cf0b143
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions docs/src/developer_documentation/tangents.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
# Tangents

As discussed in [Representing Gradients](@ref), Mooncake requires that each "primal" type `P` be associated to a unique "tangent" type `T`, given by the function [tangent_type](@ref).
As discussed in [Representing Gradients](@ref), Mooncake requires that each "primal" type be associated to a unique "tangent" type, given by the function [tangent_type](@ref).
Moreover, we must be able to "split" a given tangent into its _fdata_ ("forwards-data") and _rdata_ ("reverse-data"), whose types are given by [fdata_type](@ref) and `rdata_type` respectively.

Additionally, there is a range of things that one must be able to do with any given tangent / fdata / rdata for Mooncake to operate correctly.

## Note

The tangent type, and associated functionality, assigned automatically by Mooncake is completely adequate for the vast majority of primals.
Before diving in to add your own custom type, seriously consider whether it is worth the effort.
Very occassionally it may be necessary to specify your own tangent type.
This is not an entirely trivial undertaking, as there is quite a lot of functionality that must be added to make it work properly.
So, before diving in to add your own custom type, seriously consider whether it is worth the effort, and whether the default definition given by Mooncake are really inadequate for your use-case.

## Testing Functionality

The functionality which must work on a given type is tested over three functions:
The interface is given in the form of three functions:
```@docs
Mooncake.TestUtils.test_tangent_interface
Mooncake.TestUtils.test_tangent_splitting
Mooncake.TestUtils.test_rule_and_type_interactions
```

You can call all three of these functions at once using
```@docs
Mooncake.TestUtils.test_data
```

If all the tests in these functions pass, then you have satisfied the interface.

## Interface

Below are the docstrings for each function tested by [`Mooncake.TestUtils.test_tangent_interface`](@ref) and [`Mooncake.TestUtils.test_tangent_splitting`](@ref).
Expand Down

0 comments on commit cf0b143

Please sign in to comment.