Permuting Encoder
| 107 | // Permuting Encoder |
| 108 | // |
| 109 | FeatureShape PermutingEncoder<Domain::Feature>::shape(const TensorShape &in) const |
| 110 | { |
| 111 | assert(valid() && "invalid permutation"); |
| 112 | |
| 113 | FeatureShape out; |
| 114 | |
| 115 | out.count() = in.dim(_perm[FeatureAxis::Count]); |
| 116 | out.depth() = in.dim(_perm[FeatureAxis::Depth]); |
| 117 | out.height() = in.dim(_perm[FeatureAxis::Height]); |
| 118 | out.width() = in.dim(_perm[FeatureAxis::Width]); |
| 119 | |
| 120 | return out; |
| 121 | } |
| 122 | |
| 123 | TensorIndex PermutingEncoder<Domain::Feature>::value(const FeatureIndex &in) const |
| 124 | { |