Crop

Input

  • x:
    • Required: yes
    • Type: float16, float32, int8, uint8, int16, uint16, int32, uint32, int64, uint64
    • Description: Crops input tensor x to shape size.
    • Restriction: For the bottom to be cropped, the size of A is (20, 50, 512, 512).
    size:
    • Required: yes
    • Type: float16, float32, int8, uint8, int16, uint16, int32, uint32, int64, uint64
    • Description: Crops input tensor x to shape size.
    • Restriction: Cropping reference input. The size is (20, 10, 256, 256).

Attribute

  • axis:
    • Required: no
    • Type: int (default = 2)
    • Description: Crops input tensor x to shape size.

      axis determines the dimension from which the cropping starts and offset determines the cropping offsets of the three dimensions. The cropped length corresponds to the length of the dimension size of x2. Example:

      1. axis = 1, offset = (25, 128, 128)
      2. C = A[:,25:25+size.shape[1],128:128+size.shape[2],128:128+size.shape[3]]
    • Restriction: none
  • offset:
    • Required: yes
    • Type: ListInt
    • Description: same as axis
    • Restriction: none

Output

  • y:
    • Required: yes
    • Type: float16, float32, int8, uint8, int16, uint16, int32, uint32, int64, uint64
    • Description: Crops input tensor x to shape size.
    • Restriction: The top is cropped from x according to the shape of size, so its shape matches that of size.