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

Function ReshapeToRank3

tensorflow/core/kernels/einsum_op.cc:510–515  ·  view source on GitHub ↗

Reshapes a Tensor of shape [b0,b1...bk,N,M] to [prod(b0,b1...bk),N,M].

Source from the content-addressed store, hash-verified

508
509// Reshapes a Tensor of shape [b0,b1...bk,N,M] to [prod(b0,b1...bk),N,M].
510Status ReshapeToRank3(const Tensor& input, int batch_size, Tensor* output) {
511 const int rank = input.dims();
512 TensorShape output_shape = {batch_size, input.dim_size(rank - 2),
513 input.dim_size(rank - 1)};
514 return CopyFrom(input, output_shape, output);
515}
516
517// Contracts the inputs along the last axis. (or the second last if the
518// corresponding value of swap_free_and_contract is true). The batch dimensions

Callers 1

ContractOperandsFunction · 0.85

Calls 3

CopyFromFunction · 0.85
dimsMethod · 0.45
dim_sizeMethod · 0.45

Tested by

no test coverage detected