'Determine dimensions of cost and error buffers and allocate space from the input layer
Arguments:
in_obj (Layer): input layer from which to calculate costs'

def initialize(self, in_obj):

    assert isinstance(in_obj, Layer)
    self.prev_layer = in_obj
    self.parallelism = self.prev_layer.parallelism
    self.costfunc.parallelism = self.parallelism
    (_, self.nstep) = interpret_in_shape(in_obj.out_shape)
    self.outputs = self.be.iobuf((1, self.nstep), parallelism=self.parallelism, persist_values=False)
    self.deltas = self.be.iobuf(in_obj.out_shape, parallelism=self.parallelism, persist_values=False)
    self.cost = np.empty([1, 1], dtype=np.float32)
