GithubHelp home page GithubHelp logo

How to use Crop about mxnet.cpp HOT 3 CLOSED

dmlc avatar dmlc commented on September 1, 2024
How to use Crop

from mxnet.cpp.

Comments (3)

hjk41 avatar hjk41 commented on September 1, 2024

sorry for late reply. It should be usable using something like this:

Symbol cropped = Crop("cropped", 1, offset, h_w)(to_be_cropped_symbol)

or

Symbol cropped = Crop("cropped", 2)(to_be_cropped_symbol, shape_symbol)

from mxnet.cpp.

zhubuntu avatar zhubuntu commented on September 1, 2024

@hjk41 Thanks,I try what you say ,but it reports

错误  33  error C2064: 项不会计算为接受 2 个参数的函数  
and
错误  39  IntelliSense:  在没有适当 operator() 的情况下调用类类型的对象或将函数转换到指向函数的类

So I change the

inline Symbol Crop(const std::string& symbol_name,
                   int num_args,
                   Shape offset = Shape(0, 0),
                   Shape h_w = Shape(0, 0),
                   bool center_crop = false) {
  return Operator("Crop")
           .SetParam("num_args", num_args)
           .SetParam("offset", offset)
           .SetParam("h_w", h_w)
           .SetParam("center_crop", center_crop)
           .CreateSymbol(symbol_name);
}

to

inline Symbol Crop(const std::string& symbol_name,
    int num_args,
    Symbol data,
    Symbol crop_like,
    Shape offset = Shape(0, 0),
    Shape h_w = Shape(0, 0),
    bool center_crop = false) {
    return Operator("Crop")
        .SetParam("num_args", num_args)
        .SetParam("offset", offset)
        .SetParam("h_w", h_w)
        .SetParam("center_crop", center_crop)
        .SetInput("arg0", data)
        .SetInput("arg1", crop_like)
        .CreateSymbol(symbol_name);
}

for a temporary solution.

from mxnet.cpp.

hjk41 avatar hjk41 commented on September 1, 2024

Great move. Let me see why the code I posted does not work and fix it.

On Mon, Mar 28, 2016 at 6:35 PM, zhubuntu [email protected] wrote:

@hjk41 https://github.com/hjk41 Thanks,I try what you say ,but it
reports

错误 33 error C2064: 项不会计算为接受 2 个参数的函数 and
错误 39 IntelliSense: 在没有适当 operator() 的情况下调用类类型的对象或将函数转换到指向函数的类

So I change the

inline Symbol Crop(const std::string& symbol_name,
int num_args,
Shape offset = Shape(0, 0),
Shape h_w = Shape(0, 0),
bool center_crop = false) {
return Operator("Crop")
.SetParam("num_args", num_args)
.SetParam("offset", offset)
.SetParam("h_w", h_w)
.SetParam("center_crop", center_crop)
.CreateSymbol(symbol_name);
}

to

inline Symbol Crop(const std::string& symbol_name,
int num_args,
Symbol data,
Symbol crop_like,
Shape offset = Shape(0, 0),
Shape h_w = Shape(0, 0),
bool center_crop = false) {
return Operator("Crop")
.SetParam("num_args", num_args)
.SetParam("offset", offset)
.SetParam("h_w", h_w)
.SetParam("center_crop", center_crop)
.SetInput("arg0", data)
.SetInput("arg1", crop_like)
.CreateSymbol(symbol_name);
}

for a temporary solution.


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
#16 (comment)

HONG Chuntao
System Research Group
Microsoft Research Asia

from mxnet.cpp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.