2. To make the pastry, place flour, cocoa, butter and sugar into a food processor. Blitz until it resembles fine breadcrumbs. Add egg and blitz until it is just starting to form a ball. Place on to a floured bench and knead gently to finish combining.
3. Roll pastry out into a circle large enough to fit a 24cm tart tin. Place carefully into tin, pushing pastry gently into the edges. Cover and refrigerate for 20 minutes.
4. Line pastry with baking paper and rice and bake blind for 20 minutes. Remove and allow to cool slightly while you make the filling. Turn oven down to 160C.
5. To make the filling - Place caster sugar in a small frying pan or pot and place on a medium heat to melt. Once it has turned to caramel, add nuts and pour on to a sheet of baking paper to cool. When cold, chop roughly with a knife or blitz a couple of times in food processor until chunky.
6. Chop chocolate roughly and place in a bowl. Heat cream until scalding then pour over chocolate. Stir until very smooth.
7. Add eggs one at a time to chocolate, mixing well after each addition.
8. Arrange pears in the bottom of the tart tin. Sprinkle over half the caramelised walnuts. Pour chocolate mixture over the pears, filling the pastry to the top. Return to oven for 25 minutes until just set. Cool before serving.
9. Garnish with remaining walnuts and serve with ice cream or whipped cream.