(Reuters) - Electric car maker Tesla Inc said on Sunday it is talking with the Shanghai municipal government to set up a factory in the region and expects to agree on a plan by the end of the year.