tensorflow_mri.central_crop
tensorflow_mri.central_crop¶
- central_crop(tensor, shape)[source]¶
Crop the central region of a tensor.
- Parameters
tensor – A
Tensor.shape – A
Tensor. The shape of the region to crop. The length ofshapemust be equal to or less than the rank oftensor. If the length ofshapeis less than the rank of tensor, the operation is applied along the lastlen(shape)dimensions oftensor. Any component ofshapecan be set to the special value -1 to leave the corresponding dimension unchanged.
- Returns
A
Tensor. Has the same type astensor. The centrally cropped tensor.- Raises
ValueError – If
shapehas a rank other than 1.