class_docstr: Implement DirectPose.
class_docstr_tok: ["Implement","DirectPose","."]
code: def compute_locations(self, features):
      locations = []
      for level, feature in enumerate(features):
          h, w = feature.size()[-2:]
          locations_per_level = compute_locations(
              h, w, self.fpn_strides[level], feature.device
          )
          locations.append(locations_per_level)
      return locations
  
imports: import math
  from typing import List, Dict
  import torch
  from torch import nn
  from torch.nn import functional
  from torch.autograd import Variable
  import numpy
  from ...utils.comm import compute_locations
  from ...nn.shape_spec import ShapeSpec
  from ...nn.batch_norm import NaiveSyncBatchNorm
  from ...nn.deform_conv import DeformConvWithChangeableStride
  from ...nn.group_norm import NaiveGroupNorm
  from .directpose_outputs import DirectPoseOutputs
label_desc: Use image node_id 4 for calling the DirectPose obj's underlying member method code with example usage: obj.compute_locations(features) and returns: locations