bartorch.resize

Contents

bartorch.resize#

bartorch.resize(input, oshape, *, anchor='center')#

Crop or zero-pad input to oshape.

Parameters:
  • oshape (tuple of int) – Full output shape, one size per axis of input.

  • anchor ({"center", "front", "start"}) – What is kept in place. "center" (-c) keeps index n // 2 at m // 2; "front" (-f) keeps the last element and crops or pads at the beginning; "start" keeps the first element and crops or pads at the end.