understanding seed of a ByteTensor in PyTorch
I understand that a seed is a number used to initialize pseudo-random number generator. in pytorch, torch.get_rng_state documentation states as follows "Returns the random number generator state as a torch.ByteTensor.". and when i print it i get a 1-d tensor of size 5048 whose values are as shown below


  tensor([ 80,  78, 248,  ...,   0,   0,   0], dtype=torch.uint8)


why does a seed have 5048 values and how is this different from usual seed which we can get using  torch.initial_seed

It sounds like you're thinking of the seed and the state as equivalent.  For older pseudo-random number generators (PRNGs) that was true, but with more modern PRNGs tend to work as described here. (The answer in the link was written with respect to Mersenne Twister, but the concepts apply equally to other generators.)

Why is it a good idea to not have a 32- or 64-bit state space and report the state as the generator's output?  Because if you do that, as soon as you see any value repeat the entire sequence will repeat.  PRNGs were designed to be "full cycle," i.e., to iterate through the maximum number of values possible before repeating.  This paper showed that the birthday problem could quickly (O(sqrt(cycle-length)) identify such PRNGs as non-random.  This meant, for instance, that with 32-bit integers you shouldn't use more than ~50000 values before a statistician could call you out with a better than 99% level of confidence.  The solution, used by many modern PRNGs, is to have a larger state space and collapse it down to output a 32- or 64-bit result.  Since multiple states can produce the same output, duplicates will occur in the output stream without the entire stream being replicated.  It looks like that's what PyTorch is doing.

Given the larger state space, why allow seeding with a single integer?  Convenience.  For instance, Mersenne Twister has a 19,937 bit state space, but most people don't want to enter that much info to kick-start it.  You can if you want to, but most people use the front-end which populates the full state space from a single integer input.
