add optimizer into graph