class_docstr: Selects instances by expected gradient length [Set07]_.
class_docstr_tok: ["Selects","instances","by","expected","gradient","length","[","Set07","]","_","."]
code: def aggregate_gradient_lengths_batch(
      self, batch_len, gradient_lengths, gradients, offset
  ):
      gradient_lengths[offset : offset + batch_len] = torch.sum(
          gradients, 0
      ).to("cpu", non_blocking=True)
  
imports: import numpy
  from small_text.integrations.pytorch.exceptions import PytorchNotFoundError
  from small_text.query_strategies import constraints, QueryStrategy, EmbeddingBasedQueryStrategy
  from small_text.utils.clustering import init_kmeans_plusplus_safe
  from small_text.utils.context import build_pbar_context
  from small_text.utils.data import list_length
label_desc: Use image node_id 9 for calling the ExpectedGradientLength obj's underlying member method code with example usage: obj.aggregate_gradient_lengths_batch(batch_len, gradient_lengths, gradients, offset) without return types