square-loss layer ND-tensor support