Build functions for NengoDL

I am looking into porting my custom learning rule “mPES” from Nengo Core to NengoDL and, from what I understand, I need to implement two different build functions:

from nengo_dl.builder import Builder, NengoBuilder

@NengoBuilder.register( mPES )
def build_mpes( model, mpes, rule )
...
@Builder.register( mPES )
def build_mpes( model, mpes, rule )

the former to override the standard Nengo Core builder in order to “avoid slicing on axes > 0” and the latter for the NengoDL Simulator to build the computation graph for TensorFlow.

Do I also need to leave a third build function for when I’m using the Nengo Core Simulator? So also have:

from nengo.builder import Builder

@Builder.register( mPES )
def build_mpes( model, mpes, rule )

Yes, you would need to register it with core nengo, but you can use the same build function as the @NengoBuilder one as described below:

from nengo_dl.builder import Builder, NengoBuilder
from nengo.builder import Builder as NengoCoreBuilder

@NengoBuilder.register( mPES )
@NengoCoreBuilder.register( mPES )
def build_mpes( model, mpes, rule )
    ...
@Builder.register( mPES )
def build_mpes( model, mpes, rule )
    ```