You are pretty close. Should be something like this.
class ComputeVolSignal(CustomFactor):
inputs = [Returns(window_length=2)]
window_length = 750
def compute(self, today, assets, out, returns):
out[:] = returns.std(axis=0) * np.sqrt(250)
Not sure if it was a type but 'window_length 'was spelled wrong. Also, didn't include the required parameters in the compute method. However, the biggest issue is to include the 'axis=0' parameter in the 'std' method. Otherwise, numpy will use the flattened array. Actually a better method is 'numpy.nanstd' that will ignore any NaNs (which happen a lot). So maybe the same as above but with this line.
out[:] = np.nanstd(returns, axis=0) * np.sqrt(250)
See attached notebook.
BTW one can get some great ideas by looking at the open source code for zipline. In this case do a google search for 'zipline volatility factor github'. The second link returned (for me) is https://github.com/quantopian/zipline/blob/master/zipline/pipeline/factors/basic.py . Take a look towards the end and see the code for the 'AnnualizedVolatility' class.