Simplify pattern of successive shape.get_extent and shape.from_extent_tensor
operations and express them with the standard operation extract_element.
This transformation later circumvents the necessity to materialize shapes in
memory.
Depends On D81871
is this really needed?