caffe2::ForEach< Functor > Struct Template Reference

ForEach is a unary functor that forwards each element of the input array into the elementwise Functor provided, and gathers the results of each call into the resulting array. More...

`#include <string_ops.h>`

## Public Member Functions | |

ForEach (OperatorBase &op) | |

template<typename In , typename Out , typename Context > | |

void | operator() (int n, const In *in, Out *out, Context *) |

## Data Fields | |

Functor | functor |

struct caffe2::ForEach< Functor >

ForEach is a unary functor that forwards each element of the input array into the elementwise Functor provided, and gathers the results of each call into the resulting array.

Use it as an adaptor if you want to create a UnaryElementwiseOp that acts on each element of the tensor per function call – this is resonable for complex types where vectorization wouldn't be much of a gain, performance-wise.

Definition at line 34 of file string_ops.h.

The documentation for this struct was generated from the following file:

- caffe2/operators/string_ops.h

Generated on Tue Feb 20 2018 13:03:41 for Caffe2 - C++ API by 1.8.11