change ndim to size in layer fprop