Pytorch export to ONNX

If I would use torch.autograd.Function like this:

class CustomLayerFunction(torch.autograd.Function):
    def symbolic(g, features):
        return g.op("CustomLib::CustomLayer", features)

    def forward(ctx, features):
        return 10 * features;
    def backward(ctx, grad_output):

Pytorch will create CustomLayer node while exporting to ONNX.

Is there another way (without subclassing torch.autograd.Function) to tell Pytorch stop tracing further and insert CustomLayer node?