'Encode a box collection with respect to anchor collection.
Args:
boxes: BoxList holding N boxes to be encoded.
anchors: BoxList of N anchors.  We assume that anchors has an associated
stddev field.
Returns:
a tensor representing N anchor-encoded boxes
Raises:
ValueError: if the anchors BoxList does not have a stddev field'

def _encode(self, boxes, anchors):

    if (not anchors.has_field('stddev')):
        raise ValueError('anchors    must    have    a    stddev    field')
    box_corners = boxes.get()
    means = anchors.get()
    stddev = anchors.get_field('stddev')
    return ((box_corners - means) / stddev)
