class_docstr: Store and retrieve the train step data.
  
  This class simply stores the first step value and returns it.
  
  For most uses, ``skorch.utils.FirstStepAccumulator`` is what you
  want, since the optimizer calls the train step exactly
  once. However, some optimizerss such as LBFGSs make more than one
  call. If in that case, you don't want the first value to be
  returned (but instead, say, the last value), implement your own
  accumulator and make sure it is returned by
  ``NeuralNet.get_train_step_accumulator`` method.
class_docstr_tok: ["Store","and","retrieve","the","train","step","data",".","This","class","simply","stores","the","first","step","value","and","returns","it",".","For","most","uses",",","``","skorch.utils.FirstStepAccumulator","``","is","what","you","want",",","since","the","optimizer","calls","the","train","step","exactly","once",".","However",",","some","optimizerss","such","as","LBFGSs","make","more","than","one","call",".","If","in","that","case",",","you","do","n't","want","the","first","value","to","be","returned","(","but","instead",",","say",",","the","last","value",")",",","implement","your","own","accumulator","and","make","sure","it","is","returned","by","``","NeuralNet.get_train_step_accumulator","``","method","."]
code: def __init__(self):
      self.step = None
  
imports: from collections.abc import Mapping, Sequence
  from contextlib import contextmanager
  from enum import Enum
  from functools import partial
  import io
  from itertools import tee
  import pathlib
  import warnings
  import numpy
  from scipy import sparse
  import sklearn
  from sklearn.exceptions import NotFittedError
  from sklearn.utils import _safe_indexing
  from sklearn.utils.validation import check_is_fitted
  import torch
  from torch.nn import BCELoss
  from torch.nn import BCEWithLogitsLoss
  from torch.nn import CrossEntropyLoss
  from torch.nn.utils.rnn import PackedSequence
  from torch.utils.data.dataset import Subset
  from skorch.exceptions import DeviceWarning
  from skorch.exceptions import NotInitializedError
label_desc: Use image node_id 1 to create a new FirstStepAccumulator object  with example: obj = FirstStepAccumulator()