How to save the tensor in IValue as pt file like torch.save

class TORCH_API RecordFunction{
  ...
  c10::ArrayRef<const IValue> inputs_;
}

I want to store the tensor of inputs_, Is there any sample code showing how to save an Ivalue.