| 40 | namespace { |
| 41 | |
| 42 | Status GetAxisForPackAndUnpack(InferenceContext* c, int32 rank_after_pack, |
| 43 | int32* axis) { |
| 44 | TF_RETURN_IF_ERROR(c->GetAttr("axis", axis)); |
| 45 | if (*axis < -1 * rank_after_pack || *axis >= rank_after_pack) { |
| 46 | return errors::InvalidArgument("Invalid axis: ", *axis, "; must be in [", |
| 47 | -1 * rank_after_pack, ",", rank_after_pack, |
| 48 | ")"); |
| 49 | } |
| 50 | if (*axis < 0) *axis = (rank_after_pack + *axis); |
| 51 | return Status::OK(); |
| 52 | } |
| 53 | |
| 54 | template <typename T> |
| 55 | std::vector<int64> AsInt64(const Tensor* tensor, int64 num_elements) { |
no test coverage detected