Perform Dihderal without Affine

How can i perform dihderal without affine. I want to fit dihedral into the inference pipeline