Local tensor-network codes