{ "nbformat": 4, "nbformat_minor": 0, "metadata": { "colab": { "name": "pythos parser bug.ipynb", "provenance": [], "collapsed_sections": [] }, "kernelspec": { "name": "python3", "display_name": "Python 3" } }, "cells": [ { "cell_type": "markdown", "metadata": { "id": "Mi0XmIW7387j", "colab_type": "text" }, "source": [ "Traceback (most recent call last):\n", " File \"untitled.py\", line 4, in \n", " ,torch.ones(10,6*5*6)))\n", " File \"/usr/local/lib/python3.6/dist-packages/torch/nn/modules/linear.py\", line 72, in __init__\n", " self.weight = Parameter(torch.Tensor(out_features, in_features))\n", "TypeError: new() received an invalid combination of arguments - got (Tensor, Tensor), but expected one of:\n", " * (*, torch.device device)\n", " didn't match because some of the arguments have invalid types: (Tensor, Tensor)\n", " * (torch.Storage storage)\n", " * (Tensor other)\n", " * (tuple of ints size, *, torch.device device)\n", " * (object data, *, torch.device device)\n", "\n", "---------------------------------------------------------------------------\n", "TypeError Traceback (most recent call last)\n", " in ()\n", " 3 print(torch.nn.Linear(\n", " 4 torch.as_strided(torch.ones((4,6*5*5*70*10)),(4,6*5*5,10),(4,2,-1))\n", "----> 5 ,torch.ones(10,6*5*6)))\n", " 6 #(4,2,3),(2,3,1))\n", "\n", "/usr/local/lib/python3.6/dist-packages/torch/nn/modules/linear.py in __init__(self, in_features, out_features, bias)\n", " 70 self.in_features = in_features\n", " 71 self.out_features = out_features\n", "---> 72 self.weight = Parameter(torch.Tensor(out_features, in_features))\n", " 73 if bias:\n", " 74 self.bias = Parameter(torch.Tensor(out_features))\n", "\n", "TypeError: new() received an invalid combination of arguments - got (Tensor, Tensor), but expected one of:\n", " * (*, torch.device device)\n", " didn't match because some of the arguments have invalid types: (!Tensor!, !Tensor!)\n", " * (torch.Storage storage)\n", " * (Tensor other)\n", " * (tuple of ints size, *, torch.device device)\n", " * (object data, *, torch.device device)" ] }, { "cell_type": "code", "metadata": { "id": "g2YWcUi933Ej", "colab_type": "code", "colab": {} }, "source": [ "import torch\n", "#torch.nn.Linear(\n", "torch.as_strided(torch.ones((4,6*5*5*70*10)),(4,6*5*5,10),(4,2,-1))\n", ",torch.ones(10,6*5*6)#)\n", "#(4,2,3),(2,3,1))" ], "execution_count": null, "outputs": [] }, { "cell_type": "markdown", "metadata": { "id": "EIGhdU6q4G5x", "colab_type": "text" }, "source": [ "---------------------------------------------------------------------------\n", "TypeError Traceback (most recent call last)\n", " in ()\n", " 2 #torch.nn.Linear(\n", " 3 torch.as_strided(torch.ones((4,6*5*5*70*10)),(4,6*5*5,10),(4,2,-1))\n", "----> 4 torch.ones(\"(10,6*5*6)\")\n", " 5 #(4,2,3),(2,3,1))\n", "\n", "TypeError: ones(): argument 'size' (position 1) must be tuple of ints, not str\n", "import torch\n", "#torch.nn.Linear(\n", "torch.as_strided(torch.ones((4,6*5*5*70*10)),(4,6*5*5,10),(4,2,-1))\n", ",torch.ones(10,6*5*6)#)\n", "#(4,2,3),(2,3,1))" ] }, { "cell_type": "code", "metadata": { "id": "dhDLviK-4HZC", "colab_type": "code", "colab": {} }, "source": [ "import torch\n", "#torch.nn.Linear(\n", "torch.as_strided(torch.ones((4,6*5*5*70*10)),(4,6*5*5,10),(4,2,-1))\n", ",torch.ones(10,6*5*6)#)\n", "#(4,2,3),(2,3,1))" ], "execution_count": null, "outputs": [] } ] }