Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pytorch native code cleanup #1642

Merged
merged 3 commits into from
Sep 29, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
package com.intel.analytics.zoo.pipeline.api.net;

import com.intel.analytics.zoo.pipeline.inference.JTensor;

import java.io.File;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.net.URL;
import java.nio.channels.FileChannel;
import java.nio.channels.ReadableByteChannel;

import static java.io.File.createTempFile;
import static java.nio.channels.Channels.newChannel;

/**
* Developer API for now, intentionally remove public visibility
*/
class PytorchModelWrapper {
static JTensor[] modelForwardNative(
long nativeRef, boolean isTraining, float[][] storage, int[] offset, int[][] shape) {
return (JTensor[]) PytorchModel.modelForwardNative(nativeRef, isTraining,
storage, offset, shape);
}

static JTensor[] modelBackwardNative(
long nativeRef, float[][] storage, int[] offset, int[][] shape) {
return (JTensor[]) PytorchModel.modelBackwardNative(nativeRef, storage, offset, shape);
}

static JTensor lossForwardNative(
long nativeRef, float[][] input_storage, int[] input_offset, int[][] input_shape,
float[][] label_storage, int[] label_offset, int[][] label_shape) {
return (JTensor) PytorchModel.lossForwardNative(nativeRef, input_storage, input_offset,
input_shape, label_storage, label_offset, label_shape);
}

static JTensor[] lossBackwardNative(long nativeRef) {
return (JTensor[]) PytorchModel.lossBackwardNative(nativeRef);
}

}

This file was deleted.

Loading