Skip to content
This repository was archived by the owner on Nov 17, 2023. It is now read-only.
This repository was archived by the owner on Nov 17, 2023. It is now read-only.

[Bug][Numpy] Very basic functionality of Gluon is broken #18193

@sxjscience

Description

@sxjscience

After #17283, the following very basic example of gluon is broken:

import mxnet as mx
mx.npx.set_np()
from mxnet.gluon import nn
net = nn.Dense(16, in_units=16)
net.initialize()
out = net(mx.np.ones((32, 16)))
out.asnumpy()
~/mxnet/python/mxnet/numpy/random.py in uniform(low, high, size, dtype, ctx, out)
    135     inequality condition.
    136     """
--> 137     return _mx_nd_np.random.uniform(low, high, size=size, ctx=ctx, dtype=dtype, out=out)
    138 
    139 

~/mxnet/python/mxnet/ndarray/numpy/random.py in uniform(low, high, size, dtype, ctx, out)
    135     if size == ():
    136         size = None
--> 137     return _api_internal.uniform(low, high, size, ctx, dtype, out)
    138 
    139 

~/mxnet/python/mxnet/_ffi/_ctypes/function.py in __call__(self, *args)
    113                 self.handle, values, tcodes, ctypes.c_int(num_args),
    114                 ctypes.byref(ret_val), ctypes.byref(ret_tcode)) != 0:
--> 115             raise get_last_ffi_error()
    116         _ = temp_args
    117         _ = args

MXNetError: Traceback (most recent call last):
  File "../src/imperative/./imperative_utils.h", line 251
MXNetError: Check failed: outputs[i]->dtype() == out_types[i] (0 vs. 1) : 0-th output has invalid dtype. Expecting 1 got 0 in operator _npi_uniform

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions