For the intent code, I think you want:

    img = nib.Nifti1Image(tensor_vals_reordered.astype(np.float32), img.get_affine())
    hdr = img.get_header()
    hdr.set_intent('symmetric matrix', 3) # 3x3 symmetric matrix
    nib.save(img, ...

Does that work?