Extract the crop layer parameters with defaults.
(fn)
| 38 | |
| 39 | |
| 40 | def crop_params(fn): |
| 41 | """ |
| 42 | Extract the crop layer parameters with defaults. |
| 43 | """ |
| 44 | params = fn.params.get('crop_param', fn.params) |
| 45 | axis = params.get('axis', 2) # default to spatial crop for N, C, H, W |
| 46 | offset = np.array(params.get('offset', 0), ndmin=1) |
| 47 | return (axis, offset) |
| 48 | |
| 49 | |
| 50 | class UndefinedMapException(Exception): |