array_helpers.py 648 B

12345678910111213141516171819202122232425
  1. ## @package arra_helpers
  2. # Module caffe2.python.helpers.array_helpers
  3. def concat(model, blobs_in, blob_out, **kwargs):
  4. """Depth Concat."""
  5. if kwargs.get('order') and kwargs.get('axis'):
  6. # The backend throws an error if both are given
  7. kwargs.pop('order')
  8. return model.net.Concat(
  9. blobs_in,
  10. [blob_out, "_" + blob_out + "_concat_dims"],
  11. **kwargs
  12. )[0]
  13. def depth_concat(model, blobs_in, blob_out, **kwargs):
  14. """The old depth concat function - we should move to use concat."""
  15. print("DepthConcat is deprecated. use Concat instead.")
  16. return concat(blobs_in, blob_out, **kwargs)