tidy3d.plugins.autograd.functions.pad#
- class pad[source]#
- Bases: - Pad an array along specified axes with a given mode and padding width. - Parameters:
- array (np.ndarray) β The input array to pad. 
- pad_width (Union[int, Tuple[int, int]]) β The number of values padded to the edges of each axis. If an integer is provided, it is used for both the left and right sides. If a tuple is provided, it specifies the padding for the left and right sides respectively. 
- mode (PaddingType = "constant") β The padding mode to use. 
- axis (Union[int, Iterable[int], None] = None) β The axis or axes along which to pad. If None, padding is applied to all axes. 
- constant_value (float = 0.0) β The value to set the padded values for βconstantβ mode. 
 
- Returns:
- The padded array. 
- Return type:
- np.ndarray 
- Raises:
- ValueError β If the padding width has more than two elements or if padding is negative. 
- IndexError β If an axis is out of range for the array dimensions. 
 
 - Inherited Common Usage