  from typing import Dict, Any, Optional, Iterable
  from pathlib import Path
  
  from spacy.training import Example
  from spacy.util import resolve_dot_names
  from wasabi import msg
 
</s> remove     X = _get_docs()
    # The output vector might differ from the official type of the output layer
 </s> add  </s> remove                     if node.has_dim(name):
                        msg.info(f" - dim {name}: {node.get_dim(name)}")
                    else:
                        msg.info(f" - dim {name}: {node.has_dim(name)}")

 </s> add                     msg.info(f" - dim {name}: {node.maybe_get_dim(name)}") </s> remove def get_gradient(goldY, Y, ops):
    return ops.asarray(Y) - ops.asarray(goldY)


def _simulate_gold(element, counter=1):
    if isinstance(element, Iterable):
        for i in range(len(element)):
            element[i] = _simulate_gold(element[i], counter + i)
        return element
    else:
        return 1 / counter


 </s> add  </s> remove     prediction = model.predict(X)
 </s> add     prediction = model.predict([ex.predicted for ex in examples]) </s> remove         if tok2vec:
            tok2vec.update([Example.from_dict(x, {}) for x in X])
        Y, get_dX = model.begin_update(X)
        if goldY is None:
            goldY = _simulate_gold(Y)
        dY = get_gradient(goldY, Y, model.ops)
        get_dX(dY)
        model.finish_update(optimizer)
 </s> add         if upstream_component:
            upstream_component.update(examples)
        pipe.update(examples)
import itertools
  from typing import Dict, Any, Optional, Iterable
  from pathlib import Path
import itertools
  
  from spacy.training import Example
  from spacy.util import resolve_dot_names
  from wasabi import msg
keep add keep keep keep keep
 Fix 'debug model' for transformers + generalize (#7973)

* add overrides to docs

* fix debug model with transformer

* assume training data is set in config 
spacy/cli/debug_model.py