-1

Google Colabrotary is failing with IndentationError: expected an indented block.

Code

def zero_pad(X, pad):
    X_pad = np.pad( X, ((0,0), (pad,pad), (pad,pad), (0,0)), 'constant', 
    constant_values)
    return X_pad`

Error

File "<ipython-input-4-a7791c18ae10>", line 2
    X_pad = np.pad( X, ((0,0), (pad,pad), (pad,pad), (0,0)), 'constant', constant_values)
        ^
***IndentationError: expected an indented block***
Doug Richardson
  • 10,483
  • 6
  • 51
  • 77
MURAT
  • 1
  • 2

1 Answers1

-1

Just remove the space before the def block and code like this:

import numpy as np
def zero_pad(X, pad):
  X_pad = np.pad(X, ((0,0), (pad,pad), (pad,pad), (0,0)), 'constant', constant_values) 
  return X_pad
Siddharth Agrawal
  • 2,960
  • 3
  • 16
  • 37