get4D method

double get4D(
  1. int b,
  2. int c,
  3. int h,
  4. int w,
)

Fast accessor for 4D tensor: [b, c, h, w].

Implementation

double get4D(int b, int c, int h, int w) {
  return data[b * strides[0] + c * strides[1] + h * strides[2] + w];
}