{"id":5320,"date":"2022-01-01T06:29:33","date_gmt":"2022-01-01T06:29:33","guid":{"rendered":"https:\/\/www.aiproblog.com\/index.php\/2022\/01\/01\/one-dimensional-tensors-in-pytorch\/"},"modified":"2022-01-01T06:29:33","modified_gmt":"2022-01-01T06:29:33","slug":"one-dimensional-tensors-in-pytorch","status":"publish","type":"post","link":"https:\/\/www.aiproblog.com\/index.php\/2022\/01\/01\/one-dimensional-tensors-in-pytorch\/","title":{"rendered":"One-Dimensional Tensors in Pytorch"},"content":{"rendered":"<p>Author: Muhammad Asad Iqbal Khan<\/p>\n<div>\n<p>PyTorch is an open-source deep learning framework based on Python language. It allows you to build, train, and deploy deep learning models, offering a lot of versatility and efficiency.<\/p>\n<p>PyTorch is primarily focused on tensor operations while a tensor can be a number, matrix, or a multi-dimensional array.<\/p>\n<p>In this tutorial, we will perform some basic operations on one-dimensional tensors as they are complex mathematical objects and an essential part of the PyTorch library. Therefore, before going into the detail and more advanced concepts, one should know the basics.<\/p>\n<p>After going through this tutorial, you will:<\/p>\n<ul>\n<li>Understand the basics of one-dimensional tensor operations in PyTorch.<\/li>\n<li>Know about tensor types and shapes and perform tensor slicing and indexing operations.<\/li>\n<li>Be able to apply some methods on tensor objects, such as mean, standard deviation, addition, multiplication, and more.<\/li>\n<\/ul>\n<p>Let\u2019s get started.<\/p>\n<div id=\"attachment_13162\" style=\"width: 810px\" class=\"wp-caption aligncenter\">\n<img decoding=\"async\" aria-describedby=\"caption-attachment-13162\" class=\"size-full wp-image-13162\" src=\"https:\/\/machinelearningmastery.com\/wp-content\/uploads\/2021\/12\/jo-szczepanska-9OKGEVJiTKk-unsplash.jpg\" alt=\"\" width=\"800\" srcset=\"https:\/\/machinelearningmastery.com\/wp-content\/uploads\/2021\/12\/jo-szczepanska-9OKGEVJiTKk-unsplash.jpg 1920w, https:\/\/machinelearningmastery.com\/wp-content\/uploads\/2021\/12\/jo-szczepanska-9OKGEVJiTKk-unsplash-300x200.jpg 300w, https:\/\/machinelearningmastery.com\/wp-content\/uploads\/2021\/12\/jo-szczepanska-9OKGEVJiTKk-unsplash-1024x683.jpg 1024w, https:\/\/machinelearningmastery.com\/wp-content\/uploads\/2021\/12\/jo-szczepanska-9OKGEVJiTKk-unsplash-768x512.jpg 768w, https:\/\/machinelearningmastery.com\/wp-content\/uploads\/2021\/12\/jo-szczepanska-9OKGEVJiTKk-unsplash-1536x1024.jpg 1536w, https:\/\/machinelearningmastery.com\/wp-content\/uploads\/2021\/12\/jo-szczepanska-9OKGEVJiTKk-unsplash-600x400.jpg 600w\" sizes=\"(max-width: 1920px) 100vw, 1920px\"><\/p>\n<p id=\"caption-attachment-13162\" class=\"wp-caption-text\">One-Dimensional Tensors in Pytorch<br \/>Picture by <a href=\"https:\/\/unsplash.com\/photos\/9OKGEVJiTKk\">Jo Szczepanska<\/a>. Some rights reserved.<\/p>\n<\/div>\n<h2><strong>Types and Shapes of One-Dimensional Tensors<\/strong><\/h2>\n<p>First off, let\u2019s import a few libraries we\u2019ll use in this tutorial.<\/p>\n<pre class=\"urvanov-syntax-highlighter-plain-tag\">import torch\r\nimport numpy as np \r\nimport pandas as pd<\/pre>\n<p>If you have experience in other programming languages, the easiest way to understand a tensor is to consider it as a multidimensional array. Therefore, a one-dimensional tensor is simply a one-dimensional array, or a vector. In order to convert a list of integers to tensor, apply <code>torch.tensor()<\/code> constructor. For instance, we\u2019ll take a list of integers and convert it to various tensor objects.<\/p>\n<pre class=\"urvanov-syntax-highlighter-plain-tag\">int_to_tensor = torch.tensor([10, 11, 12, 13])\r\nprint(\"Tensor object type after conversion: \", int_to_tensor.dtype)\r\nprint(\"Tensor object type after conversion: \", int_to_tensor.type())<\/pre>\n<\/p>\n<pre class=\"urvanov-syntax-highlighter-plain-tag\">Tensor object type after conversion:  torch.int64\r\nTensor object type after conversion:  torch.LongTensor<\/pre>\n<p>Also, you can apply the same method torch.tensor() to convert a float list to a float tensor.<\/p>\n<pre class=\"urvanov-syntax-highlighter-plain-tag\">float_to_tensor = torch.tensor([10.0, 11.0, 12.0, 13.0])\r\nprint(\"Tensor object type after conversion: \", float_to_tensor.dtype)\r\nprint(\"Tensor object type after conversion: \", float_to_tensor.type())<\/pre>\n<\/p>\n<pre class=\"urvanov-syntax-highlighter-plain-tag\">Tensor object type after conversion:  torch.float32\r\nTensor object type after conversion:  torch.FloatTensor<\/pre>\n<p>Note that elements of a list that need to be converted into a tensor must have the same type. Moreover, if you want to convert a list to a certain tensor type, torch also allows you to do that. The code lines below, for example, will convert a list of integers to a float tensor.<\/p>\n<pre class=\"urvanov-syntax-highlighter-plain-tag\">int_list_to_float_tensor = torch.FloatTensor([10, 11, 12, 13])\r\nint_list_to_float_tensor.type()\r\nprint(\"Tensor  type after conversion: \", int_list_to_float_tensor.type())<\/pre>\n<\/p>\n<pre class=\"urvanov-syntax-highlighter-plain-tag\">Tensor  type after conversion:  torch.FloatTensor<\/pre>\n<p>Similarly, <code>size()<\/code> and <code>ndimension()<\/code> methods allow you to find the size and dimensions of a tensor object.<\/p>\n<pre class=\"urvanov-syntax-highlighter-plain-tag\">print(\"Size of the int_list_to_float_tensor: \", int_list_to_float_tensor.size())\r\nprint(\"Dimensions of the int_list_to_float_tensor: \",int_list_to_float_tensor.ndimension())<\/pre>\n<\/p>\n<pre class=\"urvanov-syntax-highlighter-plain-tag\">Size of the int_list_to_float_tensor:  torch.Size([4])\r\nDimensions of the int_list_to_float_tensor:  1<\/pre>\n<p>For reshaping a tensor object, <code>view()<\/code> method can be applied. It takes <code>rows<\/code> and <code>columns<\/code> as arguments. As an example, let\u2019s use this method to reshape <code>int_list_to_float_tensor<\/code>.<\/p>\n<pre class=\"urvanov-syntax-highlighter-plain-tag\">reshaped_tensor = int_list_to_float_tensor.view(4, 1)\r\nprint(\"Original Size of the tensor: \", reshaped_tensor)\r\nprint(\"New size of the tensor: \", reshaped_tensor)<\/pre>\n<\/p>\n<pre class=\"urvanov-syntax-highlighter-plain-tag\">Original Size of the tensor:  tensor([[10.],\r\n        [11.],\r\n        [12.],\r\n        [13.]])\r\nNew size of the tensor:  tensor([[10.],\r\n        [11.],\r\n        [12.],\r\n        [13.]])<\/pre>\n<p>As you can see, the <code>view()<\/code> method has changed the size of the tensor to <code>torch.Size([4, 1])<\/code>, with 4 rows and 1 column.<\/p>\n<p>While the number of elements in a tensor object should remain constant after <code>view()<\/code> method is applied, you can use <code>-1<\/code> (such as <code>reshaped_tensor<strong>.<\/strong>view(-1, 1)<\/code>) to reshape a dynamic-sized tensor.<\/p>\n<h3><strong>Converting Numpy Arrays to Tensors<\/strong><\/h3>\n<p>Pytorch also allows you to convert NumPy arrays to tensors. You can use <code>torch.from_numpy<\/code> for this operation. Let\u2019s take a NumPy array and apply the operation.<\/p>\n<pre class=\"urvanov-syntax-highlighter-plain-tag\">numpy_arr = np.array([10.0, 11.0, 12.0, 13.0])\r\nfrom_numpy_to_tensor = torch.from_numpy(numpy_arr)\r\n\r\nprint(\"dtype of the tensor: \", from_numpy_to_tensor.dtype)\r\nprint(\"type of the tensor: \", from_numpy_to_tensor.type())<\/pre>\n<\/p>\n<pre class=\"urvanov-syntax-highlighter-plain-tag\">dtype of the tensor:  torch.float64\r\ntype of the tensor:  torch.DoubleTensor<\/pre>\n<p>Similarly, you can convert the tensor object back to a NumPy array. Let\u2019s use the previous example to show how it\u2019s done.<\/p>\n<pre class=\"urvanov-syntax-highlighter-plain-tag\">tensor_to_numpy = from_numpy_to_tensor.numpy()\r\nprint(\"back to numpy from tensor: \", tensor_to_numpy)\r\nprint(\"dtype of converted numpy array: \", tensor_to_numpy.dtype)<\/pre>\n<\/p>\n<pre class=\"urvanov-syntax-highlighter-plain-tag\">back to numpy from tensor:  [10. 11. 12. 13.]\r\ndtype of converted numpy array:  float64<\/pre>\n<\/p>\n<h3><strong>Converting Pandas Series to Tensors<\/strong><\/h3>\n<p>You can also convert a pandas series to a tensor. For this, first you\u2019ll need to store the pandas series with <code>values()<\/code> function using a NumPy array.<\/p>\n<pre class=\"urvanov-syntax-highlighter-plain-tag\">pandas_series=pd.Series([1, 0.2, 3, 13.1])\r\nstore_with_numpy=torch.from_numpy(pandas_series.values)\r\nprint(\"Stored tensor in numpy array: \", store_with_numpy)\r\nprint(\"dtype of stored tensor: \", store_with_numpy.dtype)\r\nprint(\"type of stored tensor: \", store_with_numpy.type())<\/pre>\n<\/p>\n<pre class=\"urvanov-syntax-highlighter-plain-tag\">Stored tensor in numpy array:  tensor([ 1.0000,  0.2000,  3.0000, 13.1000], dtype=torch.float64)\r\ndtype of stored tensor:  torch.float64\r\ntype of stored tensor:  torch.DoubleTensor<\/pre>\n<p>Furthermore, the Pytorch framework allows us to do a lot with tensors such as its <code>item()<\/code> method returns a python number from a tensor and <code>tolist()<\/code> method returns a list.<\/p>\n<pre class=\"urvanov-syntax-highlighter-plain-tag\">new_tensor=torch.tensor([10, 11, 12, 13]) \r\nprint(\"the second item is\",new_tensor[1].item())\r\ntensor_to_list=new_tensor.tolist()\r\nprint('tensor:', new_tensor,\"nlist:\",tensor_to_list)<\/pre>\n<\/p>\n<pre class=\"urvanov-syntax-highlighter-plain-tag\">the second item is 11\r\ntensor: tensor([10, 11, 12, 13])\r\nlist: [10, 11, 12, 13]<\/pre>\n<\/p>\n<h2><strong>Indexing and Slicing in One-Dimensional Tensors<\/strong><\/h2>\n<p>Indexing and slicing operations are almost the same in Pytorch as python. Therefore, the first index always starts at 0 and the last index is less than the total length of the tensor. Use square brackets to access any number in a tensor.<\/p>\n<pre class=\"urvanov-syntax-highlighter-plain-tag\">tensor_index = torch.tensor([0, 1, 2, 3])\r\nprint(\"Check value at index 0:\",tensor_index[0])\r\nprint(\"Check value at index 3:\",tensor_index[3])<\/pre>\n<\/p>\n<pre class=\"urvanov-syntax-highlighter-plain-tag\">Check value at index 0: tensor(0)\r\nCheck value at index 3: tensor(3)<\/pre>\n<p>Like a list in python, you can also perform slicing operations on the values in a tensor. Moreover, the Pytorch library allows you to change certain values in a tensor as well.<\/p>\n<p>Let\u2019s take an example to check how these operations can be applied.<\/p>\n<pre class=\"urvanov-syntax-highlighter-plain-tag\">example_tensor = torch.tensor([50, 11, 22, 33, 44])\r\nsclicing_tensor = example_tensor[1:4]\r\nprint(\"example tensor : \", example_tensor)\r\nprint(\"subset of example tensor:\", sclicing_tensor)<\/pre>\n<\/p>\n<pre class=\"urvanov-syntax-highlighter-plain-tag\">example tensor :  tensor([50, 11, 22, 33, 44])\r\nsubset of example tensor: tensor([11, 22, 33])<\/pre>\n<p>Now, let\u2019s change the value at index 3 of <code>example_tensor<\/code>:<\/p>\n<pre class=\"urvanov-syntax-highlighter-plain-tag\">print(\"value at index 3 of example tensor:\", example_tensor[3])\r\nexample_tensor[3] = 0\r\nprint(\"new tensor:\", example_tensor)<\/pre>\n<\/p>\n<pre class=\"urvanov-syntax-highlighter-plain-tag\">value at index 3 of example tensor: tensor(0)\r\nnew tensor: tensor([50, 11, 22,  0, 44])<\/pre>\n<\/p>\n<h2><strong>Some Functions to Apply on One-Dimensional Tensors<\/strong><\/h2>\n<p>In this section, we\u2019ll review some statistical methods that can be applied on tensor objects.<\/p>\n<h3><strong>Min and Max Functions<\/strong><\/h3>\n<p>These two useful methods are employed to find the minimum and maximum value in a tensor. Here is how they work.<\/p>\n<p>We\u2019ll use a <code>sample_tensor<\/code> as an example to apply these methods.<\/p>\n<pre class=\"urvanov-syntax-highlighter-plain-tag\">sample_tensor = torch.tensor([5, 4, 3, 2, 1])\r\nmin_value = sample_tensor.min()\r\nmax_value = sample_tensor.max()\r\nprint(\"check minimum value in the tensor: \", min_value)\r\nprint(\"check maximum value in the tensor: \", max_value)<\/pre>\n<\/p>\n<pre class=\"urvanov-syntax-highlighter-plain-tag\">check minimum value in the tensor:  tensor(1)\r\ncheck maximum value in the tensor:  tensor(5)<\/pre>\n<\/p>\n<h3><strong>Mean and Standard Deviation<\/strong><\/h3>\n<p>Mean and standard deviation are often used while doing statistical operations on tensors. You can apply these two metrics using <code>.mean()<\/code> and <code>.std()<\/code> functions in Pytorch.<\/p>\n<p>Let\u2019s use an example to see how these two metrics are calculated.<\/p>\n<pre class=\"urvanov-syntax-highlighter-plain-tag\">mean_std_tensor = torch.tensor([-1.0, 2.0, 1, -2])\r\nMean = mean_std_tensor.mean()\r\nprint(\"mean of mean_std_tensor: \", Mean)\r\nstd_dev = mean_std_tensor.std()\r\nprint(\"standard deviation of mean_std_tensor: \", std_dev)<\/pre>\n<\/p>\n<pre class=\"urvanov-syntax-highlighter-plain-tag\">mean of mean_std_tensor:  tensor(0.)\r\nstandard deviation of mean_std_tensor:  tensor(1.8257)<\/pre>\n<\/p>\n<h2><strong>Simple Addition and Multiplication Operations on One-Dimensional Tensors<\/strong><\/h2>\n<p>Addition and Multiplication operations can be easily applied on tensors in Pytorch. In this section, we\u2019ll create two one-dimensional tensors to demonstrate how these operations can be used.<\/p>\n<pre class=\"urvanov-syntax-highlighter-plain-tag\">a = torch.tensor([1, 1])\r\nb = torch.tensor([2, 2])\r\n\r\nadd = a + b\r\nmultiply = a * b\r\n\r\nprint(\"addition of two tensors: \", add)\r\nprint(\"multiplication of two tensors: \", multiply)<\/pre>\n<\/p>\n<pre class=\"urvanov-syntax-highlighter-plain-tag\">addition of two tensors:  tensor([3, 3])\r\nmultiplication of two tensors:  tensor([2, 2])<\/pre>\n<p>For your convenience, below is all the examples above tying together so you can try them in one shot:<\/p>\n<pre class=\"urvanov-syntax-highlighter-plain-tag\">import torch\r\nimport numpy as np\r\nimport pandas as pd\r\n\r\nint_to_tensor = torch.tensor([10, 11, 12, 13])\r\nprint(\"Tensor object type after conversion: \", int_to_tensor.dtype)\r\nprint(\"Tensor object type after conversion: \", int_to_tensor.type())\r\n\r\nfloat_to_tensor = torch.tensor([10.0, 11.0, 12.0, 13.0])\r\nprint(\"Tensor object type after conversion: \", float_to_tensor.dtype)\r\nprint(\"Tensor object type after conversion: \", float_to_tensor.type())\r\n\r\nint_list_to_float_tensor = torch.FloatTensor([10, 11, 12, 13])\r\nint_list_to_float_tensor.type()\r\nprint(\"Tensor  type after conversion: \", int_list_to_float_tensor.type())\r\n\r\nprint(\"Size of the int_list_to_float_tensor: \", int_list_to_float_tensor.size())\r\nprint(\"Dimensions of the int_list_to_float_tensor: \",int_list_to_float_tensor.ndimension())\r\n\r\nreshaped_tensor = int_list_to_float_tensor.view(4, 1)\r\nprint(\"Original Size of the tensor: \", reshaped_tensor)\r\nprint(\"New size of the tensor: \", reshaped_tensor)\r\n\r\nnumpy_arr = np.array([10.0, 11.0, 12.0, 13.0])\r\nfrom_numpy_to_tensor = torch.from_numpy(numpy_arr)\r\nprint(\"dtype of the tensor: \", from_numpy_to_tensor.dtype)\r\nprint(\"type of the tensor: \", from_numpy_to_tensor.type())\r\n\r\ntensor_to_numpy = from_numpy_to_tensor.numpy()\r\nprint(\"back to numpy from tensor: \", tensor_to_numpy)\r\nprint(\"dtype of converted numpy array: \", tensor_to_numpy.dtype)\r\n\r\npandas_series=pd.Series([1, 0.2, 3, 13.1])\r\nstore_with_numpy=torch.from_numpy(pandas_series.values)\r\nprint(\"Stored tensor in numpy array: \", store_with_numpy)\r\nprint(\"dtype of stored tensor: \", store_with_numpy.dtype)\r\nprint(\"type of stored tensor: \", store_with_numpy.type())\r\n\r\nnew_tensor=torch.tensor([10, 11, 12, 13]) \r\nprint(\"the second item is\",new_tensor[1].item())\r\ntensor_to_list=new_tensor.tolist()\r\nprint('tensor:', new_tensor,\"nlist:\",tensor_to_list)\r\n\r\ntensor_index = torch.tensor([0, 1, 2, 3])\r\nprint(\"Check value at index 0:\",tensor_index[0])\r\nprint(\"Check value at index 3:\",tensor_index[3])\r\n\r\nexample_tensor = torch.tensor([50, 11, 22, 33, 44])\r\nsclicing_tensor = example_tensor[1:4]\r\nprint(\"example tensor : \", example_tensor)\r\nprint(\"subset of example tensor:\", sclicing_tensor)\r\n\r\nprint(\"value at index 3 of example tensor:\", example_tensor[3])\r\nexample_tensor[3] = 0\r\nprint(\"new tensor:\", example_tensor)\r\n\r\nsample_tensor = torch.tensor([5, 4, 3, 2, 1])\r\nmin_value = sample_tensor.min()\r\nmax_value = sample_tensor.max()\r\nprint(\"check minimum value in the tensor: \", min_value)\r\nprint(\"check maximum value in the tensor: \", max_value)\r\n\r\nmean_std_tensor = torch.tensor([-1.0, 2.0, 1, -2])\r\nMean = mean_std_tensor.mean()\r\nprint(\"mean of mean_std_tensor: \", Mean)\r\nstd_dev = mean_std_tensor.std()\r\nprint(\"standard deviation of mean_std_tensor: \", std_dev)\r\n\r\na = torch.tensor([1, 1])\r\nb = torch.tensor([2, 2])\r\nadd = a + b\r\nmultiply = a * b\r\nprint(\"addition of two tensors: \", add)\r\nprint(\"multiplication of two tensors: \", multiply)<\/pre>\n<\/p>\n<h2>Further Reading<\/h2>\n<p>Developed at the same time as TensorFlow, PyTorch used to have a simpler syntax until TensorFlow adopted Keras in its 2.x version. To learn the basics of PyTorch, you may want to read the PyTorch tutorials:<\/p>\n<ul>\n<li><a href=\"https:\/\/pytorch.org\/tutorials\/\">https:\/\/pytorch.org\/tutorials\/<\/a><\/li>\n<\/ul>\n<p>Especially the basics of PyTorch tensor can be found in the Tensor tutorial page:<\/p>\n<ul>\n<li><a href=\"https:\/\/pytorch.org\/tutorials\/beginner\/basics\/tensorqs_tutorial.html\">https:\/\/pytorch.org\/tutorials\/beginner\/basics\/tensorqs_tutorial.html<\/a><\/li>\n<\/ul>\n<p>There are also quite a few books on PyTorch that are suitable for beginners. A more recently published book should be recommended as the tools and syntax are actively evolving. One example is<\/p>\n<ul>\n<li>Deep Learning with PyTorch by Eli Stevens, Luca Antiga, and Thomas Viehmann, 2020.<br \/><a href=\"https:\/\/www.manning.com\/books\/deep-learning-with-pytorch\">https:\/\/www.manning.com\/books\/deep-learning-with-pytorch<\/a>\n<\/li>\n<\/ul>\n<h2><strong>Summary<\/strong><\/h2>\n<p>In this tutorial, you\u2019ve discovered how to use one-dimensional tensors in Pytorch.<\/p>\n<p>Specifically, you learned:<\/p>\n<ul>\n<li>The basics of one-dimensional tensor operations in PyTorch<\/li>\n<li>About tensor types and shapes and how to perform tensor slicing and indexing operations<\/li>\n<li>How to apply some methods on tensor objects, such as mean, standard deviation, addition, and multiplication<\/li>\n<\/ul>\n<p>The post <a rel=\"nofollow\" href=\"https:\/\/machinelearningmastery.com\/one-dimensional-tensors-in-pytorch\/\">One-Dimensional Tensors in Pytorch<\/a> appeared first on <a rel=\"nofollow\" href=\"https:\/\/machinelearningmastery.com\/\">Machine Learning Mastery<\/a>.<\/p>\n<\/div>\n<p><a href=\"https:\/\/machinelearningmastery.com\/one-dimensional-tensors-in-pytorch\/\">Go to Source<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Author: Muhammad Asad Iqbal Khan PyTorch is an open-source deep learning framework based on Python language. It allows you to build, train, and deploy deep [&hellip;] <span class=\"read-more-link\"><a class=\"read-more\" href=\"https:\/\/www.aiproblog.com\/index.php\/2022\/01\/01\/one-dimensional-tensors-in-pytorch\/\">Read More<\/a><\/span><\/p>\n","protected":false},"author":1,"featured_media":5321,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"footnotes":""},"categories":[24],"tags":[],"_links":{"self":[{"href":"https:\/\/www.aiproblog.com\/index.php\/wp-json\/wp\/v2\/posts\/5320"}],"collection":[{"href":"https:\/\/www.aiproblog.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.aiproblog.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.aiproblog.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.aiproblog.com\/index.php\/wp-json\/wp\/v2\/comments?post=5320"}],"version-history":[{"count":0,"href":"https:\/\/www.aiproblog.com\/index.php\/wp-json\/wp\/v2\/posts\/5320\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.aiproblog.com\/index.php\/wp-json\/wp\/v2\/media\/5321"}],"wp:attachment":[{"href":"https:\/\/www.aiproblog.com\/index.php\/wp-json\/wp\/v2\/media?parent=5320"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.aiproblog.com\/index.php\/wp-json\/wp\/v2\/categories?post=5320"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.aiproblog.com\/index.php\/wp-json\/wp\/v2\/tags?post=5320"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}