func (mt *ModelType) ID() aggregatorpb.ModelID {
	mt.prod.Lock()
	defer mt.prod.Unlock()
	if (mt.prod.modelID != aggregatorpb.ModelID{}) {
		return mt.prod.modelID
	}
	return aggregatorpb.ModelID{
		Domain:    mt.Domain,
		ModelType: mt.ModelType,
	}
}
ID returns the current model ID. If there a production model loaded it
returns the production model ID, otherwise, the ID field will be blank and
just have the domain and model type.
package lukai
import (
	"time"
	context "golang.org/x/net/context"
	tensorflow "github.com/tensorflow/tensorflow/tensorflow/go"
	"github.com/luk-ai/lukai/protobuf/aggregatorpb"
	"github.com/luk-ai/lukai/tf"
)
func (mt *ModelType) shouldLoadProdModelRLocked() bool {
	return mt.prod.model == nil || mt.prod.lastUpdate.Before(time.Now().Add(-outOfDateModelTimeout))
}
func (mt *ModelType) loadProdModelRLocked(ctx context.Context) error {
	if !mt.shouldLoadProdModelRLocked() {
		return nil
	}
	mt.prod.RUnlock()
	defer mt.prod.RLock()
	mt.prod.Lock()
	defer mt.prod.Unlock()
	if !mt.shouldLoadProdModelRLocked() {
		return nil
	}
	conn, err := dial(ctx, EdgeAddress)
	if err != nil {
		return err
	}
	defer conn.Close()
	c := aggregatorpb.NewEdgeClient(conn)
	resp, err := c.ProdModel(ctx, &aggregatorpb.ProdModelRequest{
		Id: aggregatorpb.ModelID{
			Domain:    mt.Domain,
			ModelType: mt.ModelType,
		},
	})
	if err != nil {
		return err
	}
	if resp.Id == mt.prod.modelID {
		mt.prod.lastUpdate = time.Now()
		return nil
	}
	if mt.prod.model != nil {
		if err := mt.prod.model.Close(); err != nil {
			return err
		}
		mt.prod.model = nil
		mt.prod.modelID = aggregatorpb.ModelID{}
	}
	modelResp, err := c.ModelURL(ctx, &aggregatorpb.ModelURLRequest{
		Id: resp.Id,
	})
	if err != nil {
		return err
	}
	mt.prod.model, err = tf.GetModel(modelResp.Url)
	if err != nil {
		return err
	}
	mt.prod.modelID = resp.Id
	mt.prod.lastUpdate = time.Now()
	mt.prod.cache = makeTFOpCache(mt.prod.model)
	return nil
}