MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / GetAxisForPackAndUnpack

Function GetAxisForPackAndUnpack

tensorflow/core/ops/array_ops.cc:42–52  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

40namespace {
41
42Status 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
54template <typename T>
55std::vector<int64> AsInt64(const Tensor* tensor, int64 num_elements) {

Callers 1

array_ops.ccFile · 0.85

Calls 2

InvalidArgumentFunction · 0.85
GetAttrMethod · 0.45

Tested by

no test coverage detected