frpays / lc0-js

The LC0 engine ported to javascript with Emscripten.
GNU General Public License v3.0
103 stars 23 forks source link

Make the backend 'cpu' work. #18

Closed frpays closed 5 years ago

frpays commented 5 years ago

As of tensorflowjs 14.1, it appears that the BN does not work with data in 'channelsFirst' (NCHW). It treats all as 'channelsLast' (NHWC). As a work-around, the network can now be built in either in channelsFirst or channelsLast format. The 'webgl' backend gets a 'channelsLast' network and the 'cpu' backend gets a 'channelsFirst' one.

Strangely, it appears that 'channelsFirst' is faster for both backends.