inline int NodeOffset(int b, int h, int w, int height, int width) {
  return (b * height + h) * width + w;
}
inline int NodeOffset(int b, int h, int w, int height, int width) {
  return (b * height + h) * width + w;
}