**Notes**: **This API is ONLY available in Dygraph mode** Returns a numpy array shows the value of current :ref:`api_guide_Variable_en` Returns: ndarray: The numpy value of current Variable. Returns type: ndarray: dtype is same
(self, *, force=True)
| 1941 | |
| 1942 | @fake_interface_only |
| 1943 | def numpy(self, *, force=True): |
| 1944 | """ |
| 1945 | **Notes**: |
| 1946 | **This API is ONLY available in Dygraph mode** |
| 1947 | |
| 1948 | Returns a numpy array shows the value of current :ref:`api_guide_Variable_en` |
| 1949 | |
| 1950 | Returns: |
| 1951 | ndarray: The numpy value of current Variable. |
| 1952 | |
| 1953 | Returns type: |
| 1954 | ndarray: dtype is same as current Variable |
| 1955 | |
| 1956 | Examples: |
| 1957 | .. code-block:: pycon |
| 1958 | |
| 1959 | >>> import paddle |
| 1960 | >>> import paddle.base as base |
| 1961 | >>> from paddle.nn import Linear |
| 1962 | >>> import numpy as np |
| 1963 | |
| 1964 | >>> data = np.random.uniform(-1, 1, [30, 10, 32]).astype('float32') |
| 1965 | >>> with base.dygraph.guard(): |
| 1966 | ... linear = Linear(32, 64) |
| 1967 | ... data_tensor = paddle.to_tensor(data) |
| 1968 | ... x = linear(data_tensor) |
| 1969 | ... print(x.numpy()) |
| 1970 | |
| 1971 | """ |
| 1972 | pass |
| 1973 | |
| 1974 | @non_static_only |
| 1975 | def backward(self, retain_graph=False): |
no outgoing calls